分页:
上一页 1 2 3 4 5 6 [7] 8 9 10 下一页
d = d - c
End If
Next i
Print d
End Sub
程序运行后,如果单击命令按钮,则在窗体上输入的内容为
A)10
B)16
C)12
D)20
(32)设有如下程序:
Private Sub Command1_Click()
Dim c As Integer, d As Integer
c = 4
d = InputBox("请输入一个整数")
Do While d > 0
If d > c Then
c = c + 1
End If
d = InputBox("请输入一个整数")
Loop
Print c + d
End Sub
程序运行后,单击命令按钮如果在输入对话框中依次输入1、2、3、4、5、6、7、8、9、0,则输出结果是:
A)12
B)11
C)10
D)9
(33)在窗体上画一个名称为Command1的命令按钮和一个名称为Text1的文本框,在文本框中输入以下字符串:
Microsoft Visual Basic Programming
然后编写如下事件过程:
Private Sub Command1_Click()
Open "d:\temp\outf.txt" For Output As #1
For i = 1 To Len(Text1.Text)
c = Mid(Text1.Text, i, 1)
If c >= "A" And c <= "Z" Then
Print #1, LCase(c)
End If
Next i
Close
End Sub
程序运行后,单击命令按狃,文件outf.txt中的内容是:
A)MVBP
B)mvbp
C)M
V
B
P
D)m
v
b
p
(34)在窗体上画一个名称为Command1的命令按钮,然后编写如下程序:
Dim SW As Boolean
Function func(X As Integer) As Integer
If X < 20 Then
Y = X
Else
Y = 20 + X
分页:
上一页 1 2 3 4 5 6 [7] 8 9 10 下一页