首页/ 题库 / [单选题]阅读下面的程序段: For i=1 To的答案

阅读下面的程序段: 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的值为( )。

单选题
2022-01-05 13:59
A、9
B、14
C、20
D、21
查看答案

正确答案
C

试题解析

标签:
感兴趣题目
阅读下面的程序段: For a=1 To 2 For b=1 To a For c=b To 2 i=i+1 Next Next Next Print i 执行上面的3重循环后,i的值为
以下程序的输出结果是( )。 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 Sub
有以下程序 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]); printf(" "); } 程序运行后的输出结果是
阅读程序: Option Base 1 Dim arr()As Integer Private Sub Form_Click() Dim i As Integer,j As Integer ReDim arr(3,2) For i=1 To 3 For j=1 To 2 arr(i,j)=i*2+j Next j Next i ReDim Preserve arr(3,4) For j=3 To 4 arr(3,j)=j+9 Next j Print arr(3,2)+arr(3,4) End Sub 程序运行后,单击窗体,输入结果为______。
下列程序段的执行结果为 n=0 For i=1 To 3 For j=5 To 1 Step-1 n=n+1 Next j,i Print n;j;i
下面的程序段执行后,X的结果为______。 X=0 For I=1 to 5 For j=I to 5 X=X+1 Next j Next I Print x
当发生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 Sub
编写以下程序段: 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的值为( )。
阅读下面的程序段: K=0 for I=1 to 3 for J=1 to I K=K+J Next J Next I 执行上面的语句后,K的值为______。
阅读下面的程序段: K=0 Forl=1 t03 For J=l to I K=K+J Next J Next 1 执行上面的语句后,K的值为______。
阅读下面的程序段: K=0 For I=1 to 3 For J=1 to I K=K+J Next J Next I 执行上面的语句后,K的值为______。
阅读下面程序段: For a=1 To2 For b =1 To a For c = b To 2 i=i+1 Next Next Next Print i 执行上面的3重循环后,i的值为
相关题目
运行下面的程序后,输出的结果为 Cls Dim t(5,5) as Integer For i=1 To 5:t(i,i)=1:Next For i=1 To 5 For j=1 To 5 Print t(i,j), Next j Print Next I
下面程序运行后,输出的结果是 Dim arr(3,3) For j=1 To 3 For k=1 To 3 Arr(j,k)=(j-1)*3+k Next k Next j For j=2 To 3 For j=2 To 3 Print art(k,j); Next k Print Next j
下列程序执行后,执行的结果是______ 。 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 I
以下程序的输出结果是 ______。 Dim n(2,2), i, j As Integer For i = 0 To 2 For j = 0 To 2 n(i,j) = i + j Next j Next i For i = 0 To 1 For j = 0 To 1 n(i+ 1 ,j + 1) = n(i + 1,j + 1) + n(i, j) Next j Next i Print n(i, j)
下列程序段的执行结果为______。 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
假定有以下程序段For i=1 To 3 For j=5 To 1 Srep-1 Print i*j Next jNext i则语句Print i*j 的执行次数是______。
以下程序的输出结果是( )。 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 Sub
当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 Sub
有以下程序 main() { int a[4][4]={{1,4,3,2},{8,6,5,7},{3,7,2,5},{4,8,6,1}},i,j,k,t; for(i=0;<4:i++) for(j=0;j<3;j++) for(k=j+1;k<4;k++) if(a[j][i]>a[k][i]{t=a[j][i];a[j][i]=a[k][i]=a[k][i]=t;}/*按列排序*/ for(i=0;i<4;i++)printf("%d,",a[i][i]); } 程序运行后的输出结果是
阅读下面的程序段: 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的值为( )。
运行下面的程序后,输出的结果为 Cls Dim t(5,5)as Integer For i=1 To 5:t(i,i)=1:Next For i=1 To 5 For j=1 To 5 Print t(i,j), Next Print Next
阅读下面的程序段: 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的值为( )。
运行下面的程序后,输出的结果为 Cls Dim t(5, 5) as Integer For i=1 To 5: t(i,i) =1: Next For i = 1 To 5 For j = 1 To 5 Print t(i, j), Next Print Next
阅读下面的程序段,执行上面的三重循环后,a的值为 ______ 。 For i=1 To 3 For j=1 To i For k=j To 4 a=a+1 Next k Next j Next i
假定有以下程序段 n=0 for i=1 to 3 for j=-4 to -1 n=n+1 ‘ next j next i 运行完毕后,n的值是( )
假定有以下程序段 n=0 for i=1 to 3 for j=-4 to -1 n=n+1 next j next i 运行完毕后,n的值是( )。
假定有以下程序段 n=0 for i=1 to 3 for j=-4 to -1 n=n+1 next j next i 运行完毕后,n的值是________。
假定有以下程序段 n=0 for i=1 to 3 for j=-3 to 1 n=n+1 next j next i 运行完毕后,n的值是( )。
假定有以下程序段 n=0 for i=1 to 3 for j=-4 to -1 n=n+1 next j next i 运行完毕后,n的值是(. )
有下列程序段: For i=1 To 4 x=4 For J=1 To 3 x=3 For k=1 To 2 x=x+6 Next k Next j Next i ? x 该程序段的执行结果为______。
广告位招租WX:84302438

免费的网站请分享给朋友吧