单选题
VB
题号 #142638
在窗体上画一个命令按钮和两个标签,真名和分别为 Commandl 、 Labell 和 Labe12 ,然后编写如下事件过程:
Private Sub Commandl_Chick.
a=0
For i=1 To 10
a=a+1
b=0
Forj=1 To 10
a=a+1
b=b+2
Nextj
Next i
Label1. Caption=Str(a)
Labe12.Caption=Str(b)
End Sub
程序运行后,单击命令按钮,在标签 Label1和Label2中显示的内容分别为( )。
参考答案
D
答案解析
此题考察的仍然是循环的嵌套,要注意变量a和b的变化时机。
你可能感兴趣的试题
A.Privale Sub List1_Click()
Label1.Caption=List1. ListIndex
List1.Removeltem List1.Text
End Sub
Label1.Caption=List1. ListIndex
List1.Removeltem List1.Text
End Sub
B.Private Sub List1_Click()
Label1.Name=List1. ListIndex
List1.RemoveItem List1.Text
End Sub
Label1.Name=List1. ListIndex
List1.RemoveItem List1.Text
End Sub
C.Private Sub List1_Click()
Label1.Caption=List1.Text
List1.RemovItem List1.ListIndex
End Sub
Label1.Caption=List1.Text
List1.RemovItem List1.ListIndex
End Sub
D.Private Sub List1_Click()
Label1.Name=List1. Text
List1.RemoveItem List1. ListIndex
End Sub
Label1.Name=List1. Text
List1.RemoveItem List1. ListIndex
End Sub
A.
| 1 | 2 | 3 |
| 2 | 4 | 6 |
| 3 | 6 | 9 |
B.
| 2 | 3 | 4 |
| 3 | 4 | 5 |
| 4 | 5 | 6 |
C.
| 1 | 4 | 7 |
| 2 | 5 | 8 |
| 3 | 6 | 9 |
D.
| 1 | 2 | 3 |
| 4 | 5 | 6 |
| 7 | 8 | 9 |