经过同学和学长学姐的指导,,我又研究出了一种排序方法,这种方法较之上次排序重复的复制粘贴要省事儿得多
Private Sub Command1_Click()
Font.Size = 30
Dim n As Integer
Dim slerdum(15) As Integer
n = 1
While n <= 15
slerdum(n) = Int(Rnd * 1000)
n = n + 1
Wend
Dim swap As Integer
n = 1
While n <= 14
If slerdum(n) < slerdum(n + 1) Then
swap = slerdum(n)
slerdum(n) = slerdum(n + 1)
slerdum(n + 1) = swap
End If
n = n + 1
Wend
n = 1
While n <= 15
Print slerdum(n)
n = n + 1
Wend
End Sub
这次做完感觉是用心去完成了,少了机械性的复制粘贴,以后在做实验时要注重方法
马妮娜原创