关于vb写一个随机数的小程序
发布网友
发布时间:2022-10-14 17:52
我来回答
共4个回答
热心网友
时间:2024-12-03 23:32
加QQ:59149418
热心网友
时间:2024-12-03 23:32
comamnd1抽人,comamnd2抽题
Dim temp
Private Sub Command1_Click()
Randomize
t = Split(temp, "!")
a = Int(Rnd * (UBound(t)) + 0)
MsgBox t(a)
If t(a) = t(0) Then
temp = Replace(temp, t(a) & "!", "")
Else
temp = Replace(temp, "!" & t(a), "")
End If
End Sub
Private Sub Command2_Click()
Randomize
a = Int(Rnd * 10 + 1)
MsgBox "第" & a & "题"
End Sub
Private Sub Form_Load()
For i = 1 To 43
temp = temp & i & "!"
Next
End Sub
热心网友
时间:2024-12-03 23:33
'comamnd1抽人,comamnd2抽题
Private Sub Command1_Click()
dim temp,a
Randomize
a = int (rnd*9999) mod 43+1
MsgBox "被抽到的人是:"&a&"号"
End Su
Private Sub Command2_Click()
dim a
Randomize
a = Int(Rnd*9999) mod N+1 'N是总题数
MsgBox "第" & a & "题"
End Sub
热心网友
时间:2024-12-03 23:33
VB产生不了真正的随机数,产生的是假的