Dim m As Integer
Dim a(1 To 100) As Integer
Private Sub Command1_Click()
'输入整数m,并随机产生m2个随机数
'随机数以m*m 矩阵形式在List1上显示
'代码略
End Sub
Private Sub Command2_Click()
Dim i As Integer, j As Integer ,t As Integer, k As Integer,
Dim s As String
List2.Clear
For i = 1 To m * m
k = i
For j = i + 1 To ①
If a(j) < a(k) Then k = j
Next j
If k <> i Then t = a(k): a(k) = a(i): a(i) = t
②
If Then
List2.AddItem s
s = ""
End If
Next i
End Sub
① ②