运行如下程序段,输出结果为________。 Private Sub command1_click() a = 2: b = 3: c = 4 a= a + b: b = b + a: c = b + a If a <> 3 Or b <> 3 Then a = b - a: b = c - a: c = b + a End If Print a + b + c End Sub
举一反三
- 设有下面程序: 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 Comrnand3_Click( ) Cop 2 Cop 3 Cop 4 End Sub Sub Cop (a As Integer) Static x As Integer x=x + a Print x; End Sub 程序运行后,单击命令按钮,输出结果为 A: 2 3 4 B: 2 5 9 C: 3 5 4 D: 2 4 3
- 有如下函数过程: Function secproc(x As Integer, y As Integer, z As Integer) secproc = 3 * y + z + 2 * x End Function Private Sub Command1_Click() Dim a As Integer, b As Integer, c As Integer a = 2: b = 3: c = 4 Print secproc(c, b, a) End Sub 该程序的运行结果是( )。
- 在窗体上画一个命令按钮<其名称为Command1),然后编写如下事件过程: Private Sub Command1 Click() For i=1 T04 If i=1 Thenx=i If i<=4 Then x=x+1 Print x Next i End Sub 程序运行后,单击命令按钮;其输出结果为 ______。 A: A) 1 2 3 4 B: B) 2 3 4 5 C: C) 2 3 4 4 D: D) 3 4 5 6
- 编写如下程序: 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,输出结果为(______)。