用随机函数产生10个10~100的随机整数,并用冒泡排序法(升序)顺序打印出来
新学的 还不算太懂 但急着 要这个程序 希望大家帮写一些下啦Private Sub Form_Click()
Const n = 90
Dim a(n) As Long, t As Long
For i = 10 To n
n = Int(Rnd * 90 + 10)
a(i) = Val(InputBox("输入数据", "排序"))
Print a(i);
Next i
For i = 10 To n - 1
For j = i + 1 To n
If a(i) < a(j) Then
t = a(i)
a(i) = a(j)
a(j) = t
End If
nextj
Next i
For j = 10 To n
Print a(j);
Next j
End Sub
我写的这个运行不了我也不知道哪错啦