vb程序;输入一串字符,统计各字母出现的次数,不区分大小写,并将字母出现个数显示在图片
1个回答
展开全部
Private Sub Form_Click()
Dim a(65 To 90)
s = UCase(Text1.Text)
For i = 1 To Len(s)
n = Asc(Mid(s, i, 1))
If n >= 65 And n <= 90 Then
a(n) = a(n) + 1
End If
Next i
For i = 65 To 90
Picture1.Print "字符"; Chr(i) & "的个数" & a(i)
Next i
End Sub
Dim a(65 To 90)
s = UCase(Text1.Text)
For i = 1 To Len(s)
n = Asc(Mid(s, i, 1))
If n >= 65 And n <= 90 Then
a(n) = a(n) + 1
End If
Next i
For i = 65 To 90
Picture1.Print "字符"; Chr(i) & "的个数" & a(i)
Next i
End Sub
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询