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

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

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

B.A(5)=10

C.A(5)=20

D.A(5)=40


参考答案

更多 “ 下列程序段的执行结果为______。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 ” 相关考题
考题 下列程序段的执行的结果是Dim a(10) , b(10)i=3For j=1 To 5a(j) =jb(i) =2i + jNext jPrint b(i) ; a(i)( )。A.113B.315C.311D.153

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

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

考题 (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的值为______。

考题 在执行完此程序段后,i,j值为 int i=1,j=10; do{ if(++i>j--)continue; }while(i<5);A.i=6 and j=5B.i=5 and j=5C.i=6 and j=4D.i=5 and j=6

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

考题 执行下面的程序段后i和j的结果为 int i=1,j=10; do { if(i++>--j)continue; } while(i<5);A.i=6,j=5B.i=5,j=5C.i=6,j=4D.i=5,j=6

考题 下列程序为比较排序法排序程序,请补充完该程序(该程序对10个数值数据进行排序处理)。Dim a(1 To 10)AS IntegerPrivate Sub Form. _Click()Randomizep=“”For i = 1 To 10Dox = Int (Rnd * 90) + 10yes = 0For j = 1 To【 】If x = a(j) Then yes = 1: Exit ForNextLoop While yes = 1a(i) = xNext iFor i = 1 To 9For【 】To 10If a(i) > a(j) Thent = a(i)【 】a(j) = tEnd IfNext jNext ip = Str(a(1))For i = 2 To 10p = p “,” Str(a(i))Print pNext iEnd Sub

考题 下列程序段的执行的结果是 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)A.11 3B.3 15C.3 11D.15 3

考题 以下程序段运行的结果是______。 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

考题 一下程序的作用是生成一个10×10的矩阵.该矩阵主对角线上的数据为1,其余数据为0(程序运行结果如下图所示)。该程序不完整,请补充完改程序。Private Sub Command1_Click()Dim a(10,10)As IntegerFor i=1 To【 】For j=1 To 10If【 】Then【 】=1Elsea(i,j)=0End IfNext jNext iFor i =1 To 10For j=1 To 10Print a(i,j);Next jPrintNext iEnd Sub

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

考题 下列程序段的执行结果是______。 i=4 j:5 Do i=i+1 j=j+2 Loop Until i >= 7 Print “j=”; jA.j=10B.j=11C.j=12D.j=13

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

考题 下列程序段执行后,执行的结果是______ 。 Dim M(10) Dim N(10) i=3 For j = 1 To 5 M(j) = j N(i) = 2 * i + j Next j Print N(i); M(i)A.12 4B.11 3C.3 11D.10 2

考题 ( 23 )有下面的程序段,其功能是按图 1 所示的规律输出数据Dim a ( 3 , 5 ) As IntegerFor i=1 To 3For j=1 To 5A ( i,j ) =i+jPrint a ( i,j ) ;NextPrintNext若要按图 2 所示的规律继续输出数据,则接在上述程序段后面的程序段应该是A )For i=1 To 5For j=1 To 3Print a ( j,i ) ;NextPrintNextB )For i=1 To 3For j=1 To 5Print a ( j,i ) ;NextPrintNextC )For j=1 To 5For i=1 To 3Print a ( j,i ) ;NextPrintNextD )For i=1 To 5For j=1 To 3Print a ( i,j ) ;NextPrintNext

考题 下列程序段的输出结果是( )。Dim M(5,5),S(5)For i=1 To 5S(i)=0For j=1 To 5M(i,j)=i+jS(i)=S(i)+M(i,j)Next jNext iFor Each x In SPrint 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 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

考题 在执行完此程序段后,i,j值为 int i=1-10; do{ if(++i>j--)continue; } while(i<5);A.i=6 and j=5B.i=5 and j=5C.i=6 and j=4D.i=5 and j=6

考题 下列程序段的执行结果为______。 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 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 (10,10)For i = 2 To 4For j =4 To 5A(i,j) =i*jNextNextPrint A (2,5) +A(3,4) +A(4,5)

考题 下列代码段inti=1,j=10;do{???if(i++--j)continue;}while(i5);执行完毕后,i和j的值分别是()。A、i=6?j=5B、i=5?j=5C、i=6?j=4D、i=5?j=6