第1个回答 2013-12-05
Private Sub Command1_Click()
Dim i As Integer, strTxt As String, abc(25) As Integer, bytAsc As Byte, strTemp As String
strTxt = UCase(Text1.Text)
For i = 1 To Len(strTxt)
bytAsc = Asc(Mid(strTxt, i, 1)) - 65
If bytAsc >= 0 And bytAsc <= 25 Then abc(bytAsc) = abc(bytAsc) + 1
Next
For i = 0 To 25
If abc(i) > 0 Then strTemp = strTemp & Chr(i + 65) & " 出现 " & abc(i) & " 次" & vbCrLf
Next
Text2.Text = strTemp
End Sub