import random as rd
number=rd.randint(1,100)
for i in range(10):
figure=int(input(“请输入猜的数字:”))
if figure>number: print("你猜大了") elif figure<number: print("你猜小了") else: print("你猜对了") print(f"你一共用了{i+1}次机会") break print(f"你一共还有{9-i}机会")
else:
print(“你没有猜对,结束游戏”)