利用随机函数产生10个【1,100】的随机整数 (1) 打印...2
发布网友
发布时间:2023-10-23 02:03
我来回答
共2个回答
热心网友
时间:2024-07-28 15:57
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-07-28 15:59
什么语言,随机函数,貌似是C?