Dim a(1 To 10) As Integer
Private Sub Form_click()
Cls
For i = 1 To 10
a(i) = Int(Rnd * 9) + 1
Print a(i);
Next i
Print
Call mbpx
End Sub
Sub mbpx()
Print " 冒泡排序法排序:"
For i1 = 1 To 10
For i2 = 1 To 10 - i1
If a(i2) < a(i2 + 1) Then
nn = a(i2)
a(i2) = a(i2 + 1)
a(i2 + 1) = nn
End If
Next i2
Print a(i2);
Next i1
End Sub