Dim a(1 To 10) As Integer
Private Sub Command1_Click() '产生随机数
Randomize
For i = 1 To 10
a(i) = Int(Rnd * 90 + 10)
Print a(i);
Next i
Print
End Sub
Private Sub Command2_Click() '正序排列
For i = 1 To 9
For j = i + 1 To 10
If a(i) > a(j) Then b = a(i): a(i) = a(j): a(j) = b
Next j
Next i
For i = 1 To 10
Print a(i);
Next i
Print
End Sub
Private Sub Command3_Click() '倒序排列
For i = 1 To 9
For j = i + 1 To 10
If a(i) < a(j) Then b = a(i): a(i) = a(j): a(j) = b
Next j
Next i
For i = 1 To 10
Print a(i);
Next i
Print
End Sub