Const n = 15
Const m = 100 '整数的最大值
Dim a(1 To n) As Integer
'本过程产生n个不同随机整数,区间在[1,m]之间,存储在数组a中,代码略
Private Sub Command1_Click()
Dim i As Integer
Dim flag(1 To m) As Boolean
For i = 1 To n
① = True
Next i
For i =2 To m step 2
If flag(i) Then List2.AddItem ②
Next i
For i = ③ To 1 Step -2
If flag(i) Then List2.AddItem Str(i)
Next i
End Sub