发布网友 发布时间:2022-04-26 19:00
共1个回答
热心网友 时间:2022-04-18 09:03
已经测试通过 满意就给分吧
Private Sub Command1_Click()
Dim a(5)
a(0) = 100
a(1) = 123
a(2) = 456
a(3) = 333
a(4) = 122
a(5) = 88
MsgBox "现在开始遍历输出", , "提示"
For i = 0 To UBound(a)
MsgBox "a(" & i & ")=" & a(i), , "提示"
Next
MsgBox "现在开始冒泡排序输出", , "提示"
For i = 0 To UBound(a)
For ii = i To UBound(a)
If a(i) > a(ii) Then
tmp = a(ii)
a(ii) = a(i)
a(i) = tmp
End If
Next
Next
For i = 0 To UBound(a)
MsgBox "a(" & i & ")=" & a(i), , "提示"
Next
End Sub