以下程序输出的结果是___________ 。 Dim a(5), i As Integer For i = 0 To 5 a(i) = 2 * i + 1 Next i MsgBox(a(i))
A: 程序出错
B: 1 3 5 7 9 11
C: 11
D: 9
E: 不确定
A: 程序出错
B: 1 3 5 7 9 11
C: 11
D: 9
E: 不确定
举一反三
- 下列程序运行时输出的结果是 Option Base 1 Private Sub Form_Click() Dim x (10)As Integer,y(5)As Integer For i=1 to 10 x(i)=10-i+1 Next For i=1 to 5 y(i)=x(2*i-1)+x(2*i) Next For i=1 to 5 Print y(i) Next End Sub A.3 7 11 45 19 B.19 15 11 7 3 C.1 3 5 7 9 D.不确定的值
- 下列这段代码执行后,消息框弹出的结果是______。 Dim i As Integer For i = 1 To 5 i += 2 Next i MsgBox(i)? 11|5|10|7
- 以下程序的输出结果是( )。Dim a%( ) = { 1, 2, 3, 4, 5, 6, 7 }, i%For i = 0 To a.GetUpperBound(0) a(i) = a(i) * a(i)NextMsgBox( a(i) ) A: 49 B: 0 C: 不确定 D: 程序出错
- 以下程序段实现的输出是()。for(i=0;i<;=9;i++)s[i]=i;for(i=9;i>;=0;i--)printf("%2d",s[i]);[/i][/i] A: 9 7 5 3 1 B: 1 3 5 7 9 C: 9 8 7 6 5 4 3 2 1 0 D: 0 1 2 3 4 5 6 7 8 9
- 下列程序段的执行结果为 _______。 Dim a(3, 5) As Integer Dim i As Integer, j As Integer For i = 1 To 3 For j = 1 To 5 a(i, j) = a(i - 1, j - 1) + (i - 1) * 5 + j Next j Next i Print a(3, 4)