Private Sub Command1_Click()
Const N = 10
Dim a(N) As String
For i = 1 To 10
Do
flag = True
a(i) = Chr(Asc("a") + Int(Rnd * 26))
For j = 1 To i - 1
If a(i) = a(j) Then flag = False: Exit For
Next j
Loop Until flag
Next i
Print "随机不重复的字串是"
For i = 1 To N
Print a(i);
Next i
Print
Max = a(1): Min = a(1)
For i = 1 To N
If Max < a(i) Then Max = a(i)
If Min > a(i) Then Min = a(i)
Next i
Print "最大的字符是:" & Max
Print "最小的字符是:" & Min
End Sub
温馨提示:答案为网友推荐,仅供参考