编写以下程序段: DIM I, J, K, A A=0 FOR I = 1 TO 3 FOR J = 1 TO I FOR K=-J TO 3 A=A+1 NEXT K NEXT J NEXT I 执行上面的三重循环后,变量A的值为( )。A.3B.9C.14D.21

编写以下程序段: DIM I, J, K, A A=0 FOR I = 1 TO 3 FOR J = 1 TO I FOR K=-J TO 3 A=A+1 NEXT K NEXT J NEXT I 执行上面的三重循环后,变量A的值为( )。

A.3

B.9

C.14

D.21


相关考题:

阅读下面的程序段,执行上面的三重循环后,a的值为 ______ 。 For i=1 To 3 For j=1 To i For k=j To 4 a=a+1 Next k Next j Next iA.9B.24C.14D.20

阅读下面的程序段:a=0For i=1 To 3For j=1 To iFor k=j To 3a=a+1Next kNext jNext i执行上面的程序段后,a的值为A.3B.9C.14D.21

下列程序段的执行结果为【 】。K=0For J=1 To2For I = 1 To 3K=I+1Next IFor I=1 To7K=K+INext INext JPrint K

阅读下面的程序段:sum=0for i=1 to 3for j=i to 4for k=j to 5next jnext i执行上面的三重循环后,sum的值为( )。

下列程序段的执行结果为()。 K=0 For J=1 to 2 For I = 1 to 3 K =I+1 Next I For I = 1 to 7 K = K+1 Next I Next J Print K A. 6B. 10C. 11D. 16

阅读下面的程序段:a==0For i=1 To 3For j=1 To iFor k=j To 3a=a+lNext kNext jNext i执行上面的程序段后,a的值为( )。A.3B.9C.14D.21

阅读下面的程序段: K=0 for I=1 to 3 for J=1 to I K=K+J Next J Next I 执行上面的语句后,K的值为______。A.8B.10C.14D.21

下列程序段的执行结果为______。 K=0 For J = 1 To 2 For I = 1 To 3 K=I+1 Next I For I = 1 To 7 K=K+1 Next I Next J Print KA. 10B.6C.11D.16

当Form1_Click事件发生时,窗体上显示的第三行是( )。 Option Base 1 Private Sub Form_Click() Dim i As Integer,j As Integer Dim k As Integer,a(5,5)As Integer For i=1 To 5 k=1 For j=1 To 5 If i<=j Then a(i,j)=k k=k+1 Else a(i,j)=1 End If Next j Next i For i=1 To 5 For j=1 To 5 Print a(i,j); Next j Print Next i End SubA.1 2 3 4 5B.1 1 2 3 4C.1 1 1 2 3D.1 1 1 1 2

以下程序的输出结果是( )。 Option Base 1 Private Sub Command1_Click() Dim a(10),p(3) as Integer k=5 For I-1 to 10 a(i)=I Next I For j=1 to3 p(i)=a(I*j) Next j For I=l to 3 k=k+ p (I)*2 Next I Print k End SubA.33B.28C.35D.37

阅读下列程序: Private Sub Command1_Click( ) Dim i As Integer,k As Integer k=2 For i=1 To 3 Print H(k); Next i End Sub Function H(j As Integer) a=0 Static b a=a+1 b=b+1 H=a*b+j End Function 程序运行后,单击命令按钮输出结果是A.234B.345C.567D.356

有以下程序: include main ( ){int x[ ] = {1,3,5,7,2,4,6,0} ,i,j,k;for(i =0;i 有以下程序: #include <stdio. h> main ( ) { int x[ ] = {1,3,5,7,2,4,6,0} ,i,j,k; for(i =0;i<3;i ++ ) for (j =2;j> = i;j — ) if( x[j + 1 ] > x[j] ) { k = x[j] ;x[j] = x[j + 1 ] ;x[j + 1 ] = k; } for (i =0;i<3;i++) for(j =4;j <7-i;j ++) if(x[j] >x[j+1]){ k=x[j];x[j] =x[j+1];x[j+1] =k;} for (i=0;i<8;i ++) printf("%d" ,x[i]); prinff("\n" );}程序运行后的输出结果是( )。A.75310246B.1234567C.76310462D.13570246

假定有下面的程序段: For i=1 To 3 For j=1 To i For k=j To 3 Print"i=";i,"j=";j,"k=";k Next k Next j Next i 这是一个三重循环程序,在这个程序中,外层、中层和内层循环的循环次数是A.3、6和14B.3、8和16C.3、4和12D.3、9和18

有以下程序 main() { int x[]={1,3,5,7,2,4,6,0},i,j,k; for(i=0;i=i; 有以下程序main( ){ int x[ ]={1,3,5,7,2,4,6,0},i,j,k;for(i=0;i<3;i++)for (j=2;j>=i;j--)if(x[j+1]>x[j]){ k=x[j];x[j]=x[j+1];x[j+1]=k;}for(i=0;i<3;i++)for(j=4;j<7-i;j++)if(x[j+1]>x[j]){ k=x[j];x[j]=x[j+1];x[j+1]=k;}for (i=0;i<3;i++)if(x[j]>x[j+1]){ k=x[j];x[j]=x[j+1];x[j+1]=k;}for (i=0;i<8;i++) printf("%d",x[i]);printf("\n");}程序运行后的输出结果是:A.75310246B.1234567C.76310462D.13570246

阅读下面的程序段: For i=1 To 3 For j=1 To i For k=j To 4 a=a+1 Next k Next j Next i 执行上面的三重循环后,a的值为( )。A.9B.14C.20D.21

阅读下面的程序段: For i=1 To 3 For j=i To 3 For k= 1 To 3 a=a+i Next k Next j Next i 执行上面的3重循环后,a的值为A.3B.9C.14D.30

阅读下面的程序段:for i=1 to 3for j=i to 1for k=j to 3a=a+1next knext jnext i执行上面的三重循环后,a的值为 【 】 。

23 有如下程序段,该程序段循环的次数是______。 Dim i As Integer Dim j As Integer Dim k As Integer k=0 For i = 0 To 10 Step 3 For j = 1 To 5 If j > 3 Then k = k + 4: Exit For k=k+1 Print k Next j If i > 8 Then Exit For Next iA.9B.10C.11D.12

下列程序执行后,执行的结果是______ 。 Dim M(2) For i = 1 To 2 M(i) = 0 Next i k=2 For i = 1 To k For j = 1 To k M(j) = M(i) + 1 Print M(k): Next j Next IA.1234B.0123C.223D.2345

下列程序的功能是:输入l0个整数。‘Private sub Command2_Click Dim i,j,k,temp,arr(11)As Integer Dimresult As String For k=1T0 10 arr(k)=Val(InputBox( “请输入第”k”个数:”,”数据输入窗口”)) Next k i=1 J=10 Do Temp=arr(i) arr(i)=arr(j) arr(j)=tempi=i+1 j=__________LoopWhileresule=””For k=1 To 10 result=resultarr(k)Chr(13)Nextk MsgBoxresult End Sub 横线处应填写的内容是( )。A.J-i ijB.j+1 ijC.j+1 ijD.J-1 ij

当Form_Click;事件发生时,窗体上显示的第三行是 ______。 Private Sub Form_Click() Dim i As Integer, j As Integer, k As Integer Dim x(5, 5) As Integer For i = 1 To 5 k = 1 For j = 1 To 5 If i <= j Then x(i, j) = k + 1 k=k+2 Else x(i, j) = k + 1 End If Next j Next i For i = 1 To 5 For j = 1 To 5 Print x(i, j) Next j Print Next i End SubA.22135B.21357C.22213D.13579

假定有下面的程序段: For i=1 To 3 For j = 1 To i For k=j To 3 Print "i = ";i,"j=";i,"k =";k Next k Next j Next i 这是一个三重循环程序,在这个程序中,外层、中层和内层循环的循环次数是A.3、6和14B.3、8和16C.3、4和12D.3、9和18

阅读下面的程序段: a==0 For i=1 To 3 For j=1 To i For k=j To 3 a=a+l Next k Next j Next i 执行上面的程序段后,a的值为( )。A.3B.9C.14D.21

以下程序的输出结果是( )。 Option Base 1 Private Sub Command1 Click() Dim a(10),p(3)as Integer k=5 For I=1 to 10 a(i)=I Next I For j=1 to 3 p(i)=a(I*j) Next j For I=1 to 3 k=k+p(I)*2 Next I Print k End SubA.33B.28C.35D.37

当发生Form_Click事件时,窗体上显示的第三行是( )。 Option Base 1 Private Sub Form_Click() Dim i As Integer,j As Integer,k As Integer Dim a(5,5)As Integer For i=1 To 5 k=1 For i=1 To 5 If(i<=j)Then a(i,j)=k k=k+2 Else a(i,j)=k+1 End If Next j Next i For i=1 To 5 For j=1 To 5 Print a(i,j); Next j Print Next i End SubA.1 3 5 7 9B.2 1 3 5 7C.2 2 2 1 3D.2 2 1 3 5

下列程序段的执行结果为 ______。 Dim m(3,3)As Integer Dim i As Integer Dim j As Integer Dim K As Integer For i=1 To 3 m(i,i)=i Next For i=0 To 3 For j=0 To 3 x=x+m(i,j) Next Next Print xA.3B.4C.5D.6

以下程序的输出结果是(). main()  {int  i,j,k,a=3,b=2;  i=(--a==b++)?--a:++b;  j=a++;k=b;  printf("i=%d,j=%d,k=%d/n",i,j,k);  }A、i=2,j=1,k=3B、i=1,j=1,k=2C、i=4,j=2,k=4D、i=1,j=1,k=3