编写如下程序: 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
A: BBB
B: CCC
C: AAA
D: 1
举一反三
- 下列程序段的执行结果为a=1b=0Select Case a Case 1 Select Case b Case 0 Print"**0**" Case 1 Print"**1**" End SelectCase 2 Print"**2**"End Select A.* * 0 * * B.* * 1 * * C.* * 2 * * D.0
- 以下程序段中,执行结果与其他3个选项不同的是 A: Dim y As Integer B: y = 11 C: Select Case y D: Case 15 To 5 E: Print "Executed" F: End Select G: Dim y As Integer H: y = 10 I: Select Case y J: Case Is > 10, Is < 10 K: Print " Executed " L: End Select M: Dim y As Integer N: y = 10 O: Select Case y P: Case Is > 15, 1, 5 To 8 Q: Print " Executed " R: End Select S: Dim y As Integer T: y = 10 U: Select Case y V: Case 1, 3, Is > 6 W: Print " Executed " X: End Select
- 中国大学MOOC: 下列程序的输入值为5,运行结果为( )。Private Sub Command1_Click() Dim a As Integer a = InputBox("请输入a的值") Select Case a Case 1 To 4 Print "D" Case 5 To 10 Print "C" Case 11 To 14 Print "B" Case Else Print "A" End SelectEnd Sub
- 下列程序的输出结果是 。 Private Sub exam1() a = 1 For i = 1 To 3 Select Case i Case 1, 3 a = a + 1 Case 2, 4 a = a + 2 End Select Next i MsgBox a End Sub
- 中国大学MOOC: 在窗体上添加一个命令按钮Command1,然后编写如下事件过程:Private Sub Command1_Click() x = InputBox(Input) Select Case x Case 1, 3 Print 分支 1 Case Is > 4 Print 分支 2 Case Else Print Else 分支 End SelectEnd Sub程序运行后,如果在输入对话框中输入2,则窗体上显示的是( )。