题型:综合题 题类:常考题 难易度:普通
浙江省温州市“十五校联合体”2018-2019学年高二上学期信息技术期中联考试卷
Private Sub Command1_Click()
Dim a(65 To 122) As Integer
Dim i As Integer, ch As String, count As Integer
Dim Max As Integer, Maxi As Integer, flag As Boolean
List1.Clear
flag = False
count = 0
s = Text1.Text
For i = 1 To Len(s)
ch = Mid(s, i, 1)
If ch>= "a" And ch<= "z" Or ch>= "A" And ch<= "Z" Then
a(Asc(ch)) =
If flag = False Then
count = count + 1
flag = True
End If
Else
End If
Next i
Max = 0: Maxi = 0
For i = 65 To 122 ’A的ASCII码值为65,a的ASCII码值为97
If a(i) > 0 Then
List1.AddItem Chr(i) + ": " + Str(a(i))
End If
If a(i) > Max Then
Max = a(i)
Maxi = i
End If
Next i
Label1.Caption = "频率最高字母:" +
Label2.Caption = "共有单词数:" + Str(count) + "个"
End Sub
试题篮