数学建模题,十万火急,小弟先谢谢了随机生成15个1到100之间的整数,然后将这组数由大到小排列.输出原数列与排列后的数列.(上机实验题)要用mathlab那个软件做,
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/27 04:39:16
数学建模题,十万火急,小弟先谢谢了随机生成15个1到100之间的整数,然后将这组数由大到小排列.输出原数列与排列后的数列.(上机实验题)要用mathlab那个软件做,
数学建模题,十万火急,小弟先谢谢了
随机生成15个1到100之间的整数,然后将这组数由大到小排列.输出原数列与排列后的数列.(上机实验题)
要用mathlab那个软件做,
数学建模题,十万火急,小弟先谢谢了随机生成15个1到100之间的整数,然后将这组数由大到小排列.输出原数列与排列后的数列.(上机实验题)要用mathlab那个软件做,
Dim a(1 To 15)
Dim b(1 To 15)
Private Sub Form_Load()
Randomize
For i = 1 To 15
a(i) = Int(Rnd * 100 + 1)
Next i
For i = 1 To 15
b(i) = a(i)
Next i
k = 0
While k = 0
k = 1
For i = 1 To 14
p = i + 1
If a(i) < a(p) Then
v = a(i)
a(i) = a(p)
a(p) = v
k = 0
End If
Next i
Wend
MsgBox b(1) & "," & b(2) & "," & b(3) & "," & b(4) & "," & b(5) & "," & b(6) & "," & b(7) & "," & b(8) & "," & b(9) & "," & b(10) & "," & b(11) & "," & b(12) & "," & b(13) & "," & b(14) & "," & b(15)
MsgBox a(1) & "," & a(2) & "," & a(3) & "," & a(4) & "," & a(5) & "," & a(6) & "," & a(7) & "," & a(8) & "," & a(9) & "," & a(10) & "," & a(11) & "," & a(12) & "," & a(13) & "," & a(14) & "," & a(15)
End Sub
VB6.0实践可行
不说清楚.没玩过那个