网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
6、对于下面的程序,其循环执行的次数为:______。 For i = 1 To 3 For j = 5 To 1 Step -1 Label1.Text = i + j Next j Next i
A.12
B.13
C.14
D.15
参考答案和解析
j=0,第 1 次循环:j=1,s=10。第 2 次循环:j=2,s=30。第 3 次循环:j=3,s=60。 第 4 次循环:j=4,s=100。while 条件不再满足。所以,其中循环语句的执行次数为 4。
更多 “6、对于下面的程序,其循环执行的次数为:______。 For i = 1 To 3 For j = 5 To 1 Step -1 Label1.Text = i + j Next j Next iA.12B.13C.14D.15” 相关考题
考题
以下程序的输出结果是 ______。 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)A.14B.0C.6D.值不确定
考题
阅读下面的程序段,执行上面的三重循环后,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
考题
下列程序段的执行结果为 ______。 Dim m(3,3)As Integer Dim i As Integer Dim j As Integer Dim x 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
考题
(10)假设有下列程序段: For i=1 To 3 For j=5 To 1 Step -1 Print i*j Next j Next i则语句Print i*j的执行次数是,i的值为______,j的值为______。
考题
阅读下面的程序段:sum=0for i=1 to 3for j=i to 4for k=j to 5sum=sum+1next knext jnext i执行上面的三重循环后,sam的值为______。
考题
有F面的程序段.其功能是按图1所示的规律输出数据Dim a(3,5)As IntegerFor i=1 To 3For i=1 To 5a(i,j)=i+jPrint a(i,j);NextPrintNext若要按图2所示的规律继续输出数据,则接在上述程序段后面的程序段应该是A.For i=i To 5 For j=1 To 3 Print a(j,i); Next Print NextB.For i=1 To 3 For i=1 To 5 Print a(j,i); Next Print NextC.For j=1 To 5 FOr i=1 TO 3 Print a(j,1); Next Print NextD.For i=1 To 5 For j=1 To 3 Print a(i,j); Next Print Print Next Next
考题
下列程序段的执行结果为()。 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
考题
有如下语句,执行后该段语句的循环次数是()。 Dim s,I,j as integer For I =1 to 3 For j=3 To 1 Step-1 S=I*j Next j Next I
A. 3B. 4C. 9D. 10
考题
假定有下列程序段 For i=1 TO 3 For j=5 TO 1 Step-1 Print i*j Next j Next i 则语句Print i*j的执行次数是( )。A.15B.16C.17D.18
考题
阅读下面的程序段: 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
考题
假定有下面的程序段: 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
考题
假定有以下程序段For i=1 To 3 For j=5 To 1 Srep-1 Print i*j Next jNext i则语句Print i*j 的执行次数是______。A.15B.16C.17D.18
考题
阅读下面的程序段: 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
考题
有下面的程序段,其功能是按图1所示的规律输出数据: Dim a(3,5)As Integer For i=1 To 3 For j=1 To 5 a(i,j)=i+j Print a(i,j); Next Print Next若要按图2所示的规律继续输出数据,则接在上述程序段后面的程序段应该是( )。A.For i=1 To 5 For j=1 To 3 Print a(j,i); Next Print NextB.For i=1 T0 3 For j=1 To 5 Print a(j,i); Next Print NextC.For j=l To 5 For i=1 To 3 Print a(j,i); Next Print NextD.For i=1 To 5 For=1 To 3 Print a(i,j): Next Print Next
考题
阅读下面的程序段: 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 4 For j=5 To 1 Step-1 Print i*j Next j, Next i 则语句Print i*j的执行次数是A.20B.16C.17D.18
考题
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
考题
阅读如下程序: Option Base 1 Private Sub Form Click() Dim Arr(4,4)As Integer For i=1 To 4 For j=1 To 4 Arr(i,j)=(i-1)*2+j Next j Next i For i=3 To 4 For j=3 To 4 Print Arr(j,i); Next j Print Next i End Sub 程序运行后,单击窗体,输出的结果为A.5 7 6 8B.6 8 7 9C.7 9 8 10D.8 10 8 11
考题
有如下程序 For i=1 To 3 For j=5 To 1 Step -1 Print i+ j Next j, I其循环执行的次数为:______。A.12B.13C.14D.15
考题
假定有下面的程序段: 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
考题
下列程序段的执行结果为_______。 N=0 For I=1 To 3 For J=5 To 1 Step -1 N=N+1 Next J Next I Print N;J;IA.12 0 4B.15 0 4C.12 3 1D.15 3 1
考题
阅读下面的程序段: 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
考题
编写以下程序段: 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
考题
下面的程序段执行后,X的结果为______。 X=0 For I=1 to 5 For j=I to 5 X=X+1 Next j Next I Print xA. 5B.10C.15D.20
热门标签
最新试卷