求小型酒店管理系统VB代码?
2013-07-06
展开全部
Dim arr(9) As Integer
Dim temp As Integer
' 初始化随机数生成器
Randomize()
' 产生随机数放入数组
For index As Integer = 0 To 9
arr(index) = Int(Rnd() * (99 - 10) + 1 + 10)
Next
'从大到小的排序(冒泡法)
For i As Integer = 0 To 9 - 1
For j As Integer = 0 To 9 - 1
If arr(j + 1) > arr(j) Then
temp = arr(j + 1)
arr(j + 1) = arr(j)
arr(j) = temp
End If
Next
Next
For k As Integer = 0 To 9
' 输出arr数组
Next
Dim temp As Integer
' 初始化随机数生成器
Randomize()
' 产生随机数放入数组
For index As Integer = 0 To 9
arr(index) = Int(Rnd() * (99 - 10) + 1 + 10)
Next
'从大到小的排序(冒泡法)
For i As Integer = 0 To 9 - 1
For j As Integer = 0 To 9 - 1
If arr(j + 1) > arr(j) Then
temp = arr(j + 1)
arr(j + 1) = arr(j)
arr(j) = temp
End If
Next
Next
For k As Integer = 0 To 9
' 输出arr数组
Next
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
广告
点击进入详情页
本回答由提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询