为实现上述功能的VB程序如下,在程序划线处填入合适的代码。
Dim d(1 To 20) As Integer
Const n = 20
Private Sub Form_Load()
Dim i As Integer, j As Integer, t As Single
List1.Clear
Randomize
For i = 1 To n
List1.AddItem Str(d(i))
Next i
End Sub
Private Sub Command1_Click()
Dim i As Integer, j As Integer, t1 As Integer
For i = 1 To n - 1
For j =
If d(j) < d(j - 1) Then
t1 = d(j): d(j) = d(j - 1): d(j - 1) = t1
End If
Next j
Next i
For i = 1 To n
List2.AddItem Str(d(i))
Next i
End Sub
Private Sub Command2_Click()
Dim m As Integer
m = Val(Text1.Text)
Text2.Text = “第” + Str(m) + “ 大的数为:” +
End Sub