试题 试卷
题型:单选题 题类:常考题 难易度:普通
【bj】高中信息技术综合库——枚举算法2
Private Sub Command1_Click()
i=1
j=7
Do While _______
i=_______
j=________
Loop
Text1.Text=Str(i)
Text2.Text=Str(j)
End Sub
则下列说法正确的是( )
Dim getStr As String
Dim a As String
Dim i As Integer,s As Integer
Dim q As Integer,l As Integer
s=0:q=0:l=0
getStr=Text1.Text
For i = 1 To ① ’对字符串中所有字符逐一判断
a = ②
If a >= "a" And a <= "z" Then s = s + 1
If a >= "A" And a <= "Z" Then q = q + 1
If a >= "0" And a <= "9" Then l = l + 1
Next i
Text2.Text = Str(s)
Text3.Text = Str(q)
Text4.Text = Str(l)
图1
图2
按上述要求,编写VB程序,功能如下:在文本框Text1中输入n的值,点击“开始枚举”按钮Command1,在列表框List1中输出所有方案,在列表框List2中输出比例合适方案。
实现上述功能的VB程序如下,回答下列问题:
试题篮