网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

下列程序段的输出结果为()。 Dim A(5) For i=1 to 5 A(i)=i*i Next i Print A(i)

A.55

B.0

C.18

D.下标越界出错信息


参考答案和解析
下标越界出错信息
更多 “下列程序段的输出结果为()。 Dim A(5) For i=1 to 5 A(i)=i*i Next i Print A(i)A.55B.0C.18D.下标越界出错信息” 相关考题
考题 以下程序的输出结果是D)9 12 Option Base 1 Private Sub Command1_Click() Dim s(10),p(3)As Integer k=5 For i=1 To 10 a(i)=i Next i For i=1 To 3 p(i)=a(i*i) Next I For i=1 To 3 k=k+ p(i)*2 Next i Print k End subA.33B.28C.35D.37

考题 下列程序段的执行结果为 ______。 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)A.A(5)=5B.A(5)=10C.A(5)=20D.A(5)=40

考题 下列程序段的执行结果为 ______。 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

考题 以上程序段运行的结果是:______. Dim a(-1 To 5) As Boolean Dim flag As Boolean flag = False Dim i As Integer Dim j As Integer Do Until flag = True For i = -1 To 5 j=j+1 if a(i)= False Then a(i)= True Exit For End If If i = 5 Then flag = True End If Next Loop Print jA.20B.7C.35D.8

考题 下列程序运行后,输出结果为( )。 Dim a() a=Array(1,3,5,7,9) s=0 For i=1 To 4 s=s*10+a(i) Next i Print sA.1357B.3579C.7531D.9753

考题 (25)下列程序段的输出结果是 Dim M(5,5),S(5) For i=1 To 5 S(i)=0 For j=1 To 5 M(i,j)=i+j S(i)=S(i)+M(i,j) Next j Next i For Each x In S Print x; Next xA.20 23 24 35 40 B.20 25 30 35 40 C.20 23 25 35 40 D.20 25 35 40 45

考题 下面程序:________Option Base 1Private Sub Command1_Click() Dim a(10),p(3)As Integer Dim i,k As Integer k=5 For i=1 To 10 a(i)=i Next For i=1 To 3 p(i)=a(i*i) Next For i=1 To 3 k=k+p(i)*2 Next Print kEnd Sub运行后的输出结果为________。A.33B.28C.35D.37

考题 有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

考题 下列程序段的执行结果为 ______。 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)A.A(5)=5B.A(5)=10C.A(5)=20D.A(5)=40

考题 下列程序段的执行结果为______。 Dim M(10), N(10) I=3 For T = 1 To 5 M(T) = T N(I) = 2 * I + T Next T Print N(I); M(I)A. 3 11B.3 15C.11 3D.15 3

考题 以下程序的输出结果为 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 kA.20B.21C.56D.32

考题 以下程序段运行的结果是______。 Dima(-1 To 5)As Boolean Dim flag As Boolean flag=False Dim i As Integer Dim j As Integer Do Until flag=True For i=-1 To 5 j=j+1 If a(i)=False Then a(i)=True Exit For End If If i=5 Then flag=True End If Next Loop Print jA.20B.7C.35D.8

考题 有下面的程序段,其功能是按图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

考题 下列程序段的输出结果为( )。 Dim M(5,5), S(5) For i = 1 To 5 S(i) = 0 For j = 1 To 5 M(i, j) = i + j S(i) = S(i) + M(i, j) Next j Next i For Each x In S Print x; Next xA.2023 24 3540B.2025 30 3540C.2023 25 35 40D.2025 354045

考题 下列程序段的执行结果是______。 option base 1 private eommand1_c1ick () Dim A(10) Dim E(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) End subA.A(5)=20B.A(5)=30C.A(5)=40D.A(5)=50

考题 单击一次命令按钮之后,下更程序代码的执行结果为______ 。 Public Sub Proc(a() As Integer) Static i As Integer Do a(i) = a(i) + a(i + 1) i=i+1 Loop While i < 2 End Sub Private Sub Command1_Cliek() Dim m As Integer Dim i As Integer Dim x(10) As Integer For i = 0 To 4 x(i) = i + 1 Next i For i = 1 To 2 Call Proc (x) Next i For i = 0 To 4 Print x(i); Next i End SubA.3 4 7 5 6B.3 5 7 4 5C.1 2 3 4 5D.1 2 3 5 7

考题 下列程序段的执行结果为______ 。 Dim A(10,10) For I = 2 To 4 For J = 4 To 5 A(I, J) = I * J Next J Next I Print A(2, 5) + A(3, 4) + A(4, 5)A.22B.42C.32D.52

考题 下列程序段的输出结果为( )。 Dim M(5, 5), S(5) For i=1 To 5 S(i)=0 For j=1 To 5 M(i, j)=i+j S(i)=S(i)+M(i, j) Next j Next i For Each x In S Print x; Next xA.20 23 24 35 40B.20 25 30 35 40C.20 23 25 35 40D.20 25 35 40 45

考题 下列程序段的执行结果为( )。 Dim m(10),n(10) I=3 For I=1 to 5 M(t)=t N(I)=2*I+t Next t Print n(I);m(I)A.3 11B.3 15C.11 3D.15 3

考题 以下程序的输出结果是( )。 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

考题 下列程序段的执行结果为______。 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 T0 3 For j=0 To 3 x=x+m(i, j) Next Next Print xA.3B.4C.5D.6

考题 以下程序段运行的结果是______。 Dim a(-1 To 5)As Boolean Dim flag As Boolean flag=False Dim i As Integer Dim j As Integer Do Until flag=True For i=-1 To 5 j=j+l If a(i)=False Then a(i)=True Exit For End If If i=5 Then flag=True End If Next Loop Print jA.20B.7C.35D.8

考题 下列程序段的执行结果为 Dim A(10, 10) For I=2 To 4 For J=4 To 5 A(I,J)=I*J Next J Next I Print A(2, 5)+ A(3, 4) + A(4, 5)A.22B.42C.32D.52

考题 下列程序段的输出结果为( )。 Dim M(S, S), S(5) For i=1 To 5 S(i)=0 For j=1 To 5 M(i, j)=i+j S(i)=S(i)+M(i, j) Next j Next i For Each x In S Print x; Next xA.20 23 24 35 40B.20 25 30 35 40C.20 23 25 35 40D.20 25 35 40 45

考题 下列程序段的执行结果为 Dim A(10,10) For 1=2 To 4 For J=4 To 5 A(I,J)=I*J Next J Next I Print A(2,5)+A(3,4)+A(4,5)A.22B.42C.32D.52

考题 下列程序的运行结果为 Dim a(-1 To 6) For i=LBound(a,1)To UBound(a,1) a(i) = i Next i Print a (LBound(a,1));a(UBound(a,1))A.0 0B.-5 0C.-1 6D.0 6

考题 下列程序打印结果为 ______。Private Sub Command1_ Click() Dim a(5)As String Dim b As Integer Dim i As Integer for i = 0 To 5 a(i)= i +1 Print a(i); Next iEnd SubA.12345B.6C.1 2 3 4 5 6D.0

考题 下列程序段的执行结果为______。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)A.A(5)=5B.A(5)=10C.A(5)=20D.A(5)=40