Dim a(5) As IntegerPrivate Sub Command1_Click() 'çæä¸éå¤çéæºæ°aa:Text1.Text = ""For i = 1 To 5 Randomize a(i) = Int(Rnd * 15) + 1 Text1.Text = Text1.Text & " " & a(i)Next iFor i = 1 To 5 For j = i To 4 If a(i) = a(j + 1) Then GoTo aa End If Next jNext iEnd SubPrivate Sub Command2_Click() 'æåéæºæ°Dim temp As IntegerText1.Text = ""For i = 1 To 5 For j = i To 4 If a(i) > a(j + 1) Then temp = a(j + 1) a(j + 1) = a(i) a(i) = temp End If Next j Text1.Text = Text1.Text & " " & a(i)Next iEnd Sub