Const n = 10
Dim a(1 To n+1) As Integer
'随机生成n个两位正整数,存入数组a中,代码略
Private Sub Command2_Click()
For i = 1 To n \ 2
m =
For j = i To m
If a(j) > a(j + 1) Then t = a(j): a(j) = a(j + 1): a(j + 1) = t
Next j
k = m
For j =
If a(k) > a(j) Then k = j
Next j
If k <> i Then t = a(k): : a(i) = t
Next i
s = ""
For i = 1 To n
If a(i) \ 10 Mod 2 = 1 Then s = s + Str(a(i)) Else s = Str(a(i)) + s
If Then List2.AddItem s: s = ""
Next i
End Sub