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

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

单选题
2022-01-05 15:54
A、4
B、5
C、6
D、9
查看答案

正确答案
B

试题解析

标签:
相关题目
以下程序的输出结果是 ______。 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
下列程序段的执行结果为______。 Private Sub Command1_Click() n = 0 For a = 1 To 20 For b = 1 To 20 For c = 1 To 20 If a * a + b * b - c * c Then n=n+l End If Next c Next b Next a Print n End Sub
阅读下面的程序段: 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的值为( )。
阅读下面的程序段,执行上面的三重循环后,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
下列程序段的执行结果为______。Dim A(10),B(5) For i=1 To 10 A(i)=i Nex i For j=1 To 5 B(j)=j*20 Next j A(5)=B(2) Print "A(5)=";A(5)
有下列程序段: 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 该程序段的执行结果为______。
阅读下面的程序段: 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的值为
以下程序的输出结果为 Dim i,c(10),p(3) k=5 For i=0 To 10 c(i) =i Next i For i=0 To 2 p(i) = c(i * (i + 1)) Next i For i=0 To 2 k=k+p(i) * 2 Next i Print k
下列程序段的执行结果为 ______。 Dim A(10),B(5) For i=1 To 10 A(i)=i Next i For i=1 To 5 B(j)=j*20 Next i A(5)=B(2) Print=A(5)= ";A(5)
下列程序段的执行结果为______。 Dim A(10),B(5) For i=1 To 10 A(i)=i Next i For j=1 To 5 B(j)=j*20 Next j A(5)=B(2) Print"A(5)="; A(5)
下列程序段的执行结果为 ______。 Dim A(10),B(5) For i=1 To 10 A(i)=i Next i For j=1 To 5 B(j)=j*20 Next j A(5)=B(2) Pring"A(5)=";A(5)
下列程序段的执行结果为______。 DimA(10),B(5) For i=1 To 10 A(i+=i Next i For i=1 To 5 B(j)=j*20 Nextj A(5)=B(2) Pfiat"A(5)";A(5)
若有以下程序,当程序运行后,单击命令按钮,则输出的结果为( )。 Private Sub Command1_Click() Dim a%(1 To 4), b%(3 To 6), i%, s1#, s2# For i= 1 To 4 a(i) = i Next i For i=3 To 6 b(i) = i Next i s1 = Factorial (A) s2 = Factorial (B) Print "s1="; s1; "s2="; s2 End Sub Function Factorial(a() As Integer) Dim t#, i% t=1 For i = LBound(A)To UBound(A) t = t * a(i) Next i Factorial = t End Function
下面程序段,运行后的结果是 Private Sub Commandl_Click( ) Dim b%(1 To 4),i%,t# For i=1 To 4 b(i)=i Next i t=Tof(b( ) ) Print"t=";t, End Sub Function Tof(a() As Integer) Dim t#,i% t=1 For i=2 To UBound(A)t=t * a(i) Next i Tof=t End Function
下面程序段,运行后的结果是 Private Sub Command1_Click() Dim b%(1 To 4),i%,t# For i=1 To 4 b(i) =i Next t=Tof(b() ) Print"t=";t, End Sub Function Tof(a() As Integer) Dim t#,i% t=1 For i=2 To UBound(a) t=t*a(i) Next Tof=t End Function
下面程序段,运行后的结果是 Private Sub Command1_Click() Dim b%(1 To 4) ,i%, t# For i = 1 To 4 b(i) =i Next t =Tof(b() ) Print "t ="; t, End Sub Function Tof(a() As Integer) Dim t#, i% t=1 For i =2 To UBound(A)t=t * a(i) Next Tof = t End Function
下列程序段的执行的结果是 Dim a(10),b(10) i=3 For j=1 To 5 a(j) =j b(i) =2 * i + j Next j Print b(i);a(i)
广告位招租WX:84302438

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