【加试题】小明设计了一个VB程序(界面如图16所示),随机产生n(n<=100)个大于等于a(a<=100)且小于等于b(b<=100)的整数,并在列表框List1中降序显示。
实现上述功能的VB代码如下:
请在划线处填入合适代码。
Private Sub Command1Click()
Dim a As Integer, b As Integer
Dim n As Integer, t As Integer
Dim m(1 To 100) As Integer
a = Val(Text1.Text)
b = Val(Text2.Text)
n = Val(Text3.Text)
If a > b Then t = a: a = b: b = t
Randomize
①
For i = 2 To n
m(i) = Int(Rnd * (b - a + 1)) + a
If m(i) > m(i - 1) Then
②
For j = i - 1 To 1 Step -1
If temp < m(j) Then Exit For
m(j + 1) = m(j)
Next j
③
End If
Next i
For i = 1 To n
List1.AddItem Str(m(i))
Next i
End Sub
程序①处的代码是{#blank#}1{#/blank#}
程序②处的代码是{#blank#}2{#/blank#}
程序③处的代码是{#blank#}3{#/blank#}