2个回答
2013-04-07
展开全部
我调试了,你看看
Dim upperbound, lowerbound As Integer
upperbound = Val(Text2.Text) 'upperbound 是随机数范围的上限
lowerbound = Val(Text1.Text) 'lowerbound 则是随机数范围的下限。
Text3.Text = Int((upperbound - lowerbound + 1) * Rnd + lowerbound)
</img>
Dim upperbound, lowerbound As Integer
upperbound = Val(Text2.Text) 'upperbound 是随机数范围的上限
lowerbound = Val(Text1.Text) 'lowerbound 则是随机数范围的下限。
Text3.Text = Int((upperbound - lowerbound + 1) * Rnd + lowerbound)
</img>
展开全部
Private Sub Command1_Click()
Dim min As Integer
Dim max As Integer
Dim i As Integer
min = Val(Text1.Text)
max = Val(Text2.Text)
For i = 0 To 2
Randomize
Text3.Text = Text3.Text & Int(Rnd * (max - min) + min) & " "
Next
End Sub
Dim min As Integer
Dim max As Integer
Dim i As Integer
min = Val(Text1.Text)
max = Val(Text2.Text)
For i = 0 To 2
Randomize
Text3.Text = Text3.Text & Int(Rnd * (max - min) + min) & " "
Next
End Sub
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询