VB从键盘上输入一串字符,以“?”结束,统计输入字符中的大、小写字母和数字的个数

2020-05-17 教育 110阅读
Private Sub Form_KeyPress(KeyAscii As Integer)
Static dx As Integer, xx As Integer, sz As Integer
Print Chr(KeyAscii);
Select Case KeyAscii
Case 48 To 57
sz = sz + 1
Case 65 To 90
dx = dx + 1
Case 97 To 122
xx = xx + 1
Case 63
Print
Print "大写字母:"; dx
Print "小写字母:"; xx
Print "数字:"; sz
End Select
End Sub
声明:你问我答网所有作品(图文、音视频)均由用户自行上传分享,仅供网友学习交流。若您的权利被侵害,请联系fangmu6661024@163.com