Private Sub Command1_Click()
Dim i As Integer, j As Integer, n As Integer
Dim zm As Integer, flag As Boolean, zf As string
Randomize ‘重置rnd函数,确保每次产生的随机数不一致
zf = ""
n = Val(Text1.Text)
For i = 1 To n
zm = Int(Rnd * 26 + 65)
For j = 1 To Len(zf) Step 2
If Asc(Mid(zf, j, 1)) = zm Then
flag = True
Exit For
End If
Next j
If flag = False Then zf = zf + Chr(zm) + ","
Next i
Text2.Text = zf
End Sub
Private Sub Command2_Click()
Dim i As Integer, zf As string
zf=Text2.Text
k = 1
For i = 3 To Len(zf) - 1 Step 2
If Mid(zf, k, 1) > Mid(zf, i, 1) Then k = i
Next i
List1.AddItem Mid(zf, k, 1)
Text2.Text =
End Sub