myNum = 9 print('猜数字游戏\n') while True: guess = int(input('请输一个数字:')) if guess > myNum: print('猜大了') elif guess < myNum: print('猜小了') else: print('恭喜你,猜对了!') break