Private Sub Form_Click()
Me.AutoRedraw = True
Dim a(1 To 50) As Integer
Dim minD As Integer
Dim tmpD As Integer
Dim j As Integer
minD = 51
Dim i As Long
For i = 1 To 50
Randomize
a(i) = Int(Rnd * 31 + 20)
If a(i) Mod 3 = 0 Then
If minD > a(i) Then minD = a(i): j = i
End If
Next
tmpD = a(1)
a(1) = a(j)
a(j) = tmpD
j = 0
For i = 1 To 50
If j Mod 10 = 0 Then Print
Print a(i);
j = j + 1
Next
Print "最小数:" & minD
End Su