A: Select Case x Case 1 To 10 Print "Result" End Select
B: Select Case x Case Is>5,Is<5 Print "Result" End Select
C: Select Case x Case Is>5,1,3 To 4 Print "Result" End Select
D: Select Case x Case 1,3,Is>5 Print "Result" End Select
举一反三
- 假设X的值是5,则执行以下语句时,可得到的输出结果是ABCDEF的Select Case语句是 ( ) A: Select Case X Case 10 To 1 Print“ABCDEF” End Select B: Select Case X Case Is>15,Is<5 Print"ABCDEF" End Select C: Selecl Case K Case Is>5,1,3,To 10 Print"ABCDEF" End Select D: Select Case X Case 1,3,Is>5 Print"ABCDEF" End Select
- 下列程序段的运行结果为( )。 Dim x x = Int(Rnd) + 5 Select Case x Case 5 Print "优秀" Case 4 Print "良好" Case 3 Print "及格" Case Else Print "不及格" End Select
- 以下程序段中,执行结果与其他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
- 下列程序段的执行结果为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
- 编写如下程序: 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
内容
- 0
设有下面的语句:Print IIf(x>0, 1, IIf(x<0,-1, 0))与此语句输出结果不同的程序段是______。 A: If x>0 Then x=1 ElseIf x<0 Then x=-1 End If Print x B: If x>0 Then Print 1 ElseIf x<0 Then Print-1 Else Print 0 End If C: Select Case x Case Is>0 Print 1 Case Is<0 Print-1 Case Else Print 0 End Select D: If x<>0 Then If x>0 Then Print 1 ElseIf x<0 Then Print-1 Else Print 0 End If
- 1
以下语句正确的是:______。 A: Select Case a B: Case C: b=1 D: Case “B” E: b=2 F: Case Else G: b=3 H: End Select I: Select Case a J: Case “A” K: b=1 L: Case “B” M: b=2 N: Case Default O: b=3 P: End Select Q: Switch a R: Case “A” S: b=1 T: Case “B” U: b=2 V: Case Else W: b=3 X: End Switch Y: Switch a Z: Case “A” [: b=1 \: Case “B” ]: b=2 ^: Case Default _: b=3 `: End Select
- 2
中国大学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
- 3
Select Case X结构中(X为Integer类型),如果判断条件为X=5,正确的Case语句应该是至()。 A: Case X=5 B: Case Is 5 C: Case 5 D: Case=5
- 4
下列程序运算后,Label1结果显示的是: Dim x As Integer Dim S As String x = 20 S = "2020" x = x Mod 3 Select Case x Case 0 Label1.Text = "A" Case 1 Label1.Text = "B" Case 2 Label1.Text = "C" Case Else Label1.Text = "D" End Select