close
Sub ArrayDemo()
Dim StrOutput As String
Dim a(4) As Integer
a(0) = 3
a(1) = 5
a(2) = 2
a(3) = 1
a(4) = 4
For pass = 1 To 5
For i = 0 To 4 - pass
If a(i) > a(i + 1) Then
temp = a(i)
a(i) = a(i + 1)
a(i + 1) = temp
End If
Next
StrOutput = StrOutput & a(i)
Next
MsgBox StrOutput
End Sub
全站熱搜
留言列表