用随机数产生50个[10,100]不重复的正整数放入数组,从小到大排序,每行输出10个数。
Private Sub Command1Click()
Dim a(1 To 50) As Integer, i%, j%, t%, p%, n%, x%
n=0
Randomize
Do While n<50
x=
For i= 1 To n
If Then Exit For
Next i
If i> n Then
a(n)=x
End If
Loop
For i= 1 To 49
For j=i+ 1 To 50
If a(p)> a(j) Then
Next j
t= a(p): a(p) = a(i): a(i)=t
Next i
For i= I To 50
Print a(i);
if Then Print
Next i
End Sub