Private sub Commandl_Click ()
Dim s As String
Dim n As Integer
Dim cnt As Integer
Dim i As Integer
Dim num As single
Dim cd As Single
Dim ave As single
s=Text1.Text
n=Len (s)
num=0
cd=0
cnt=0
For i=1 To n
①
If c>=“a” And c<=“z”Or c>=“A”And c<=“Z”Then
cnt=cnt+1
Elself c>=“0”And c<=“9”Then
cnt=cnt+1
Else
If cnt>0 Then
num=num+1
cd=cd+cnt
②
End If
End If
Next i
If cnt>0 Then
num=num+1
cd=cd+cnt
End If
ave=cd/num
Label1. Caption=“总共有”+Str(num)+“个单词,平均长度为”+str(ave)
End sub
① ②