虽然说上课都讲过了不过我还是假装很开心。
我就呵呵了!
呵呵!
呵呵呵呵........
Private Sub cmdSort_Click()
Dim A(14) As Integer
Dim I, J As Integer
Dim Temp As Integer
Form1.Cls
Randomize
For I = 0 To 14
A(I) = Int(Rnd * 1000)
Next I
For I = 0 To 14
For J = I + 1 To 14
If A(I) > A(J) Then
Temp = A(I)
A(I) = A(J)
A(J) = Temp
End If
Next J
Next I
Print Chr(13)
For I = 0 To 14
Print A(I);
Next I
End Sub
Dim A(14) As Integer
Dim I, J As Integer
Dim Temp As Integer
Form1.Cls
Randomize
For I = 0 To 14
A(I) = Int(Rnd * 1000)
Next I
For I = 0 To 14
For J = I + 1 To 14
If A(I) > A(J) Then
Temp = A(I)
A(I) = A(J)
A(J) = Temp
End If
Next J
Next I
Print Chr(13)
For I = 0 To 14
Print A(I);
Next I
End Sub