...1) 打印这10个数 (2) 用选择排序法按从大到小的顺序排列
发布网友
发布时间:2024-10-23 22:35
我来回答
共2个回答
热心网友
时间:2024-11-07 00:33
Private Sub Command1_Click()
Dim a(10)
Randomize
Print "随机产生10个[1,100]之间的整数"
For i = 1 To 10
a(i) = Int(Rnd * 100)
Print a(i);
Next
Print
Print "使用选择排序法从大到小排序"
For i = 1 To 10
For j = 1 To i
If a(i) > a(j) Then t = a(i): a(i) = a(j): a(j) = t
Next
Next
For i = 1 To 10
Print a(i);
Next
End Sub
热心网友
时间:2024-11-07 00:32
什么语言,随机函数,貌似是C?