编写如下程序: Private Sub Command1_Click() Dim score As Integer score = 90 If score > 80 Then r = 5 ElseIf score > 60 Then r = 3 Else r = 1 End If Print r End Sub 程序运行后,单击命令按钮Command1,输出结果为(______)。
举一反三
- 编写如下程序: Private Sub Command1_Click() Dim n As Integer : Static s As Integer For n = 1 To 3 s = s + n Next Print s End Sub 程序运行后,第三次单击命令按钮Command1时,输出结果为
- 下列程序的运行结果为( )。 Private Sub Command1_Click() Score = Int(Rnd * 10) + 80 Select Case Score Case ls < 60 a$ = "E" Case 60 To 69 a$ = "D" Case 70 To 79 a$ = "C" Case 80 To 89 a$ = "B" Case Else a$ = "A" End Select Print a$ 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
- 设有下面程序: Function F( a As Integer) b = 0 Static c b= b + 1 c= c + 2 F= a + b + c End Function Private Sub Command1_Click() Dim a As Integer a = 2 For i = 1 to 3 Print F(a); Next i End Sub 运行上面的程序,单击命令按钮 Command1 ,输出结果为________
- 编写如下程序: Private Sub Command1_Click() Dim x As Integer, y As Integer x = 1: y = 1 Do y = x * y If y > 10 Then Print x, y Exit Do Else x = x + 3 End If Loop While x <= 10 End Sub 运行程序,输出结果为______