举一反三
- 在窗体上画一个名称为Command1的命令按钮,然后编写如下事件过程: Private Sub Command1_Click() a=0 For i=1 To 2 For j=1 To 4 If j Mod 2<>0 Then a=a-1 End If a=a+1 Next j Next i Print a End Sub 程序运行后,单击命令按钮,输出结果是 A: 0 B: 2 C: 3 D: 4
- 窗体上有一个名为Command1的命令按钮,编写如下事件过程: Private Sub Command1_Click() i = 0 Do While i < 8 For j = 1 To i n = n + 1 Next i = i + 1 Loop Print n End Sub 运行程序,单击命令按钮,则输出结果是______。
- 窗体上有一个命令按钮Command1,编写如下事件过程: Private Sub Command1_Click() For i=1 to 4 For j=4 to 8 sum=sum+1 Next j Next i Print sum End Sub 运行时,单击按钮,输出结果是( )
- 在窗体上画一个命令按钮,其名称为Command1,然后编写如下事件过程: Private Sub Command1_Click() Dim a1(4, 4), a2(4, 4) For i = 1 To 4 For j = 1 To 4 a1(i, j) = i + j a2(i, j) = a1(i, j) + i + j Next j Next i Print a1(3, 3); a2(3, 3) End Sub 程序运行后,单击命令按钮,在窗体上输出的是.
- 在窗体上添加一个命令按钮Command1,然后编写如下事件过程: Private Sub Command1_Click() For i = 1 To 4 x = 4 For j = 1 To 3 x = 3 For k = 1 To 2 x = x + 6 Next k Next j Next i Print x End Sub 程序运行后,单击命令按钮,显示结果为( )。
内容
- 0
在窗体上添加一个文本框Text1和一个命令按钮Command1,然后编写如下事件过程: Private Sub Command1_Click() Dim i As Integer, n As Integer For i = 0 To 50 i = i + 3 n = n + 1 If i > 10 Then Exit For Next Text1.Text = Str(n) End Sub 程序运行后,单击命令按钮,在文本框中显示的值是( )。
- 1
在窗体上画一个命令按钮(其Name属性为Command1),然后编写如下代码: Private Sub Command1_Click() Dim a(5,5) For i=1 To 3 Forj=1 To 4 a(i,j))=i*j Next Next For n=1 To 2 For m=1 To 3 Print a(m,n); Next Next End Sub 程序运行后,单击命令按钮,输出结果是( )。 A: A) 246123 B: B) 123246 C: C) 123456 D: D) 654321
- 2
在窗体中有1个命令按钮Command1和1个文本框Text1,编写事件代码如下:Private Sub Command1_Click() For i=1 To 4 x=3 For j=1 To 3 For k=1 To 2 x=x+3 Next k Next j Next i Text1.Value=Str(x) End Sub 打开窗体运行后,单击命令按钮,文本框Text1输出的结果是
- 3
在窗体上面添加一个命令按钮Command1,然后编写如下事件过程: Private Sub Command1_Click() Dim a1(4, 4), a2(4, 4) For i = 1 To 4 For j = 1 To 4 a1(i, j) = i + j a2(i, j) = a1(i, j) + i + j Next j Next i Print a1(3, 3); a2(3, 3) End Sub 程序运行后,单击命令按钮,在窗体上输出的内容是( )
- 4
中国大学MOOC: 在窗体上添加一个命令按钮Command1,编写如下事件过程,运行时单击按钮,显示结果为( )。Private Sub Command1_Click() For i = 1 To 4 For j = 4 To 8 Sum = Sum + 1 Next j Next i Print SumEnd Sub