• 2021-04-14
    运行如下程序段,输出结果为________。 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
  • 26

    内容

    • 0

      ‎下列程序的运行结果为( )。‌‎Private Sub Command1_Click()‌‎ Dim a(5) As String‌‎ Dim i As Integer‌‎ For i = 0 To 5‌‎ a(i) = i + 1‌‎ Print a(i);‌‎ Next i‌‎End Sub‌ A: 123456 B: 6 C: 1 2 3 4 5 6 D: 0

    • 1

      设窗体上有一个Command1命令按钮,还有以下程序代码: Private Sub Command1_Click() Static x As Integer x=x+1 Call proc(x) Print x, End Sub Private Sub proc(a As Integer) Static x As Integer x=x+a:a=x End Sub 程序运行后,3次单击命令按钮,则产生的输出是 A: 1 2 3 B: 1 3 5 C: 1 3 7 D: 2 4 6

    • 2

      编写如下程序: 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时,输出结果为

    • 3

      编写如下程序: 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

    • 4

      编写如下程序: 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 运行程序,输出结果为______