题型:单选题 题类:常考题 难易度:普通
浙江省临海市白云高级中学2018-2019学年高二下学期信息技术期中考试试卷
n = 0
For i = 1 To Len(Text1.Text)
c = Mid(Text1.Text, i, 1)
If c >= "0" And c <= "9" Then m = 1 Else m = 2
a(m) = a(m) + 1
If a(m) = 1 Then n = n + 1
Next i
数组a各元素的初始值都为0,文本框Text1的内容为“Happy2017”。执行程序后,变量n的值为( )
①共八位字符,前两位为字母“zj”,后六位是数字,并以66开头(即密码格式为zj66****);
②最后两位数字相同;
③后六位数能被16和46同时整除。
单击“找回密码”按钮(Command1)后,可能的密码显示在列表框List1中。
|
Private Sub Command1Click()
Dim s As Long , a As Integer, b As Integer, c As Integer, i As Integer
For i = 0 To 9999
s = 660000 + i
If ① And s Mod 46 = 0 Then
'(选填字母,从下列A、B 、C、D四个选项中选取一项)
a = s Mod 10
b = (s Mod 100) \ 10
If ② Then '(选填字母,从下列A、B 、C、D四个选项中选取一项)
List1.AddItem ("zj" + Str(s))
c = ③ '(填程序代码)
End If
End If
Next i
Label1.Caption = "共有" + Str(c) + "个"
End Sub
试题篮