!!!!!!!!!急,一个超级简单的冒泡排序,怎么结果一直是错的?????
Private Sub Command1_Click()
Dim a(5) As Long
Dim i, j As Long
Dim temp As Long
a(0) = 68
a(1) = 100
a(2) = 18
a(3) = 188
a(4) = 80
While (i < 5)
While (j < i - 1)
If a(j) > a(j + 1) Then
temp = a(j)
a(j) = a(j + 1)
a(j + 1) = temp
End If
j = j + 1
Wend
i = i + 1
Wend
MsgBox a(0)
MsgBox a(1)
MsgBox a(2)
MsgBox a(3)
MsgBox a(4)
End Sub 怎么回事????