作业帮 > 综合 > 作业

1.任意给10个数,要求从小到大排序,并输出这10个数.

来源:学生作业帮 编辑:大师作文网作业帮 分类:综合作业 时间:2024/11/12 14:32:56
1.任意给10个数,要求从小到大排序,并输出这10个数.
1.任意给10个数,要求从小到大排序,并输出这10个数.
Private Sub Form_Click()
Dim A(10) As Integer, I As Integer
Dim J As Integer, TM As Integer
Randomize
For I = 1 To 10
A(I) = Int(90 * Rnd) + 10
Next I
For I = 1 To 9
For J = I + 1 To 10
If A(I) > A(J) Then
TM = A(I)
A(I) = A(J)
A(J) = TM
End If
Next J
Next I
For I = 1 To 10
Print A(I)
Next I
End Su