Dim a(1 To 10) As Integer
Private Sub Command1_Click()
Dim flag As Boolean
Randomize
For i = 1 To 10
flag = False
tmp = Int(Rnd * 64 + 25)
For j = 1 To i
If tmp - a(j) = 0 Then
flag = True
i = i - 1
Exit For
End If
Next
If Not flag Then a(i) = tmp
Next
For i = 1 To 9
For j = 1 To 10 - i
If a(j) < a(j + 1) Then
t = a(j)
a(j) = a(j + 1)
a(j + 1) = t
End If
Next
Next
Text1.Text = ""
For i = 1 To 10
Text1.Text = Text1.Text & a(i) & " "
Next
End Sub