Public Class Form1
Private Sub Form1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Click
Dim s(5) As Integer
Dim i, j As Integer
For i = 1 To 5
s(i) = InputBox("请输入第" & i & "个数", "冒泡排序法")
Next i
For i = 1 To 4
For j = i + i To 4
If s(i) > s(j) Then
"temp" = s(i) : s(i) = s(j) : s(j) = "temp"
End If
Next j
Next i
For i = 1 To 5
Print(s(i))
Next i
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
End Class