Private Sub Command1_Click() Dim a As Integer, b As Integer, s As String MsgBox "我记住一个数,你根据我的提示猜猜是这个数是几" Randomize a = Int(Rnd * 100) s = InputBox("写出你猜的数") Do While s <> "" b = Val(s) If a = b Then MsgBox "你真聪明!喊明孙猜对了" Exit Do ElseIf a > b Then MsgBox b & " 有点小了" ElseIf a < b Then MsgBox b & " 有点大了" End If s = InputBox("写出你猜的数") Loop MsgBox "郑链槐老88,下次再玩"End Sub