number = 45
count = 0
while count <3:
count = count + 1
print("现在开始第%s次猜数字"%(count))
guess_number = int ( input ( "猜数字:" ) )
if guess_number == number:
print ( "恭喜你第%s次猜对了!"%(count) )
break
elif guess_number > number:
print ( "往小点想!" )
else:
print ( "往大点想!" )
if count == 3:
shifoujixu =input("你还想继续玩吗?")
if shifoujixu != "n":
count =0
number = 45
count = 0
while True:
count = count + 1
print("现在开始第%s次猜数字"%(count))
guess_number = int ( input ( "猜数字:" ) )
if guess_number == number:
print ( "恭喜你第%s次猜对了!"%(count) )
break
elif guess_number > number:
print ( "往小点想!" )
else:
print ( "往大点想!" )
n = count / 3
if n.is_integer():
shifoujixu =input("你还想继续玩吗?")
if shifoujixu == "n":
print("欢迎下次再来!")
break