求助:VB中输出字符出现次数最多的那个字符(不区分大小写)及次数
Dim a(1 To 26) As Integer
Dim max As Integer
n = Len(s)
For i = 1 To n
k = Asc(Mid$(s, i, 1))
If (k >= 65 And k <= 90) Then
a(k - 64) = a(k - 64) + 1
End If
If (k >= 97 And k <= 122) Then
a(k - 96) = a(k - 96) + 1
End If
Next
max = 0
For m = 1 To 26
If max < a(m) Then
max = a(m)
End If
Next m
print max
'请把字符出现次数最多的字符的代码下下面,谢谢大神