下列程序代码的运行结果为( )。 Private Sub Command1_Click() For m = 1 To 10 Step 2 a = 10 For n = 1 To 20 Step 2 a = a + 2 Next n Next m Print a End Sub
举一反三
- 下列程序代码的运行结果为( )。Private Sub Command1_Click() For m = 1 To 10 Step 2 a = 10 For n = 1 To 20 Step 2 a = a + 2 Next n Next m Print aEnd Sub A: 60 B: 50 C: 30 D: 20
- 运行下列程序,单击窗体,在窗体上显示的结果为( )。Private Sub Form_Click() a = 0 n = 10 For i = 1 To n Step 2 a = a + 1 n = n + 5 Next i Print aEnd Sub A: 20 B: 10 C: 5 D: 出错
- 写输出下面程序的运行结果_ _。 Dim a() As Integer Private Sub Command1_Click() ReDim a(1 To 5) For i = 1 To 5 a(i) = i Next i ReDim a(1 To 10) For i = 6 To 10 a(i) = 2 * i Next i For i = 1 To 10 Print a(i); Next i End Sub
- 编写如下程序: Private Sub Command1_Click; Dim m As Integer, n As Integer m = 2 : n = 1 Select Case m Case 1 Select Case n Case 1 Print "AAA" Case 2 Print "BBB" End Select Case 2 Print "CCC" End Select End Sub 程序运行后,单击命令按钮Command1,输出结果为 A: BBB B: CCC C: AAA D: 1
- 在窗体中有一个命令按钮(名为Command1),其事件代码如下: Private Sub Command1_Click() Dim a(5, 5) For m = 2 To 3 For n = 1 To 2 a(m, n) = m * n Next n Next m MsgBox a(2, 1) + a(3, 2) End Sub 运行该窗体后,单击命令按钮,则消息框的输出结果为( )。 A: 8 B: 6 C: 2 D: 16