
大家帮我做一VB个程序,我会追加20分的
把字符做如下分类:大写字母:A…Z;小写字母:a…z;数字:0…9;其他字符。编写一个程序,根据上述分类方法,输入一个字符,报告该字符所属的类型。我会追加20分的。...
把字符做如下分类:大写字母:A…Z;小写字母:a…z;数字:0…9;其他字符。编写一个程序,根据上述分类方法,输入一个字符,报告该字符所属的类型。我会追加20分的。
展开
展开全部
怎么都没有人回答,我来给你代码好了!
Private Sub Command1_Click()
Dim abc As String
abc = InputBox("请输入一个字符")
Select Case Asc(Left(abc, 1))
Case Asc("A") To Asc("Z")
MsgBox "大写字母"
Case Asc("a") To Asc("z")
MsgBox "小写字母"
Case Asc("0") To Asc("9")
MsgBox "数字"
Case Else
MsgBox "未知类型"
End Select
End Sub
Private Sub Command1_Click()
Dim abc As String
abc = InputBox("请输入一个字符")
Select Case Asc(Left(abc, 1))
Case Asc("A") To Asc("Z")
MsgBox "大写字母"
Case Asc("a") To Asc("z")
MsgBox "小写字母"
Case Asc("0") To Asc("9")
MsgBox "数字"
Case Else
MsgBox "未知类型"
End Select
End Sub
展开全部
把字符转换成数字 对照ASCII码表,做个分类就好了,很简单的,自己写写吧,程序自己不写那成?
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
晕,这个也要求人?
你咋上的学
你咋上的学
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
“该字符所属的类型”是什么意思?
如果是FDAjkr541,那么输出结果是如何?
如果是FDAjkr541,那么输出结果是如何?
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Private Sub Command1_Click()
WhatType
End Sub
Private Sub Form_Load()
Text1.Text = ""
Text1.MaxLength = 1
End Sub
Private Sub WhatType()
If Text1.Text = "" Then
MsgBox "请输入一个字符"
Exit Sub
End If
If Asc(Text1.Text) > 64 And Asc(Text1.Text) < 91 Then
MsgBox "大写字母" & Text1.Text
ElseIf Asc(Text1.Text) > 96 And Asc(Text1.Text) < 123 Then
MsgBox "小写字母" & Text1.Text
ElseIf Asc(Text1.Text) > 47 And Asc(Text1.Text) < 58 Then
MsgBox "数字" & Text1.Text
Else
MsgBox "其他字符" & Text1.Text
End If
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
WhatType
End If
End Sub
WhatType
End Sub
Private Sub Form_Load()
Text1.Text = ""
Text1.MaxLength = 1
End Sub
Private Sub WhatType()
If Text1.Text = "" Then
MsgBox "请输入一个字符"
Exit Sub
End If
If Asc(Text1.Text) > 64 And Asc(Text1.Text) < 91 Then
MsgBox "大写字母" & Text1.Text
ElseIf Asc(Text1.Text) > 96 And Asc(Text1.Text) < 123 Then
MsgBox "小写字母" & Text1.Text
ElseIf Asc(Text1.Text) > 47 And Asc(Text1.Text) < 58 Then
MsgBox "数字" & Text1.Text
Else
MsgBox "其他字符" & Text1.Text
End If
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
WhatType
End If
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询