随机十个数排序法排序

来源:互联网 发布:弱电网络系统图 编辑:程序博客网 时间:2024/05/29 19:24

Private Sub Command1_Click()

Dim j As Integer

For j = 1 To 9

For i = j + 1 To 10

   If a(j) < a(i) Then

      swap a(j), a(i)

   End If

Nexti

Next j

For i = 1 To 10

   Print a(i);

Next i

Print

 

End Sub

Private Function swap(a As Integer, b AsInteger)

Dim t As Integer

t = a

a = b

b = t

End Function


0 0
原创粉丝点击