展开全部
Private Sub Command1_Click()
Dim a(25) As Integer
s = Text1
For i = 1 To Len(s)
c = Mid(s, i, 1)
If c >= "a" And c <= "z" Then c = Chr(Asc(c) - 32)
If c >= "A" And c <= "Z" Then
j = Asc(c) - 65
a(j) = a(j) + 1
End If
Next i
j = 0
For i = 0 To 25
If a(i) > 0 Then
j = j + 1
Text2 = Text2 & Chr(65 + i) & "=" & a(i) & " "
If j Mod 8 = 0 Then Text2 = Text2 & vbCrLf
End If
Next i
End Sub
Private Sub Form_Load()
Text1 = ""
Text2 = ""
End Sub
展开全部
用公式SUMPRODUCT试试看可以不
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2018-12-03
展开全部
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
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询