第一题
Private Sub Command1_Click()
Cls
total (Text1.text)
End Sub
Sub total(text)
FirstChr = Left(text, 1) '截取左边第一个字母
times = 0
For i = 1 To Len(text)
If Mid(text, i, 1) = FirstChr Then '统计第一个字母出现的次数
times = times + 1
End If
Next
newstr = Replace(text, FirstChr, "") '清除字符串中的第一个字母
Print FirstChr & "出现次数为" & times
If newstr <> "" Then
total (newstr) '如果字符串不为空,继续调用,直到字符串为空
End If
End Sub