Private Sub Command1_Click()
Me.Font.Size = 10
Dim a(10) As Integer
Dim i As Integer
Dim j As Integer
For i = 1 To 10
a(i) = 10 + Int(Rnd() * 100)
Print a(i)
Next i
Print
For i = 1 To 9
For j = i + 1 To 10
If a(i) < a(j) Then
swap a(j), a(i)
End If
Next j
Next i
For j = 1 To 10
Print a(j)
Next j
Print
End Sub
Private Sub swap(a As Integer, b As Integer)
Dim t As Integer
t = a
a = b
b = t
End Sub
Me.Font.Size = 10
Dim a(10) As Integer
Dim i As Integer
Dim j As Integer
For i = 1 To 10
a(i) = 10 + Int(Rnd() * 100)
Print a(i)
Next i
For i = 1 To 9
For j = i + 1 To 10
If a(i) < a(j) Then
swap a(j), a(i)
End If
Next j
Next i
For j = 1 To 10
Print a(j)
Next j
End Sub
Private Sub swap(a As Integer, b As Integer)
Dim t As Integer
t = a
a = b
b = t
End Sub