2。 15个0——99的正整数,降序排列?
3。 1
222
33333
4444444
的程序??
考试的,求你了!谢!
2.
Option Explicit
Option Base 1
Private Sub Command1_Click()
Randomize
Dim a(15) As Integer
Dim i As Integer
Dim j As Integer
Dim t As Integer
For i = 1 To 15
a(i) = Int(99 * Rnd + 1)
Next
Print
Print "原数据是:"
For i = 1 To 15
Print a(i);
Next
Print
For i = 1 To 14
For j = 1 To (15 - i)
If a(j) < a(j + 1) Then
t = a(j)
a(j) = a(j + 1)
a(j + 1) = t
End If
Next
Next
Print
Print "排序后:"
For i = 1 To 15
Print a(i);
Next
End Sub