VB:连续掷骰子,显示每次投掷的结果,直至出现6点为止,显示已投掷的次数。
发布网友
发布时间:2022-12-21 07:21
我来回答
共1个回答
热心网友
时间:2023-10-08 00:30
Private Sub Form_Click()
Dim n As Integer, m
Cls
Do Until n = 6
Randomize
n = Int(Rnd * 6) + 1
Print "点数:"; n
m = m + 1
Loop
Print String(10, "*") & vbNewLine & "次数:"; m
End Sub
热心网友
时间:2023-10-08 00:31
Private Sub Form_Click()
Dim n As Integer, m
Cls
Do Until n = 6
Randomize
n = Int(Rnd * 6) + 1
Print "点数:"; n
m = m + 1
Loop
Print String(10, "*") & vbNewLine & "次数:"; m
End Sub