Option Explicit '三个数不可重复 Private Sub Command1_Click() Dim a, b, c Do a = Int(Rnd * 12) + 1 b = Int(Rnd * 12) + 1 c = Int(Rnd * 12) + 1 If a / b = c And a <> b And b <> c And a <> c Then Debug.Print a; "÷"; b; "="; c Exit Do End If Loop
End Sub '三个数可重复 Private Sub Command2_Click() Dim a, b, c Do a = Int(Rnd * 12) + 1 b = Int(Rnd * 12) + 1 c = Int(Rnd * 12) + 1 If a / b = c Then Debug.Print a; "÷"; b; "="; c Exit Do End If Loop