if __name__ == '__main__':
money, n = input().split(" ")
res = []
for i in range(int(n)):
inputs = input().split(" ")
if int(inputs[2]) > int(money):
res.append("Not enough tokens. Total = %s." % money)
elif (int(inputs[0]) > int(inputs[3]) and inputs[1] == "0") or (
int(inputs[0]) < int(inputs[3]) and inputs[1] == "1"):
money = str(int(money) + int(inputs[2]))
res.append("Win %s! Total = %s." % (inputs[2], money))
else:
money = str(int(money) - int(inputs[2]))
res.append("Lose %s. Total = %s." % (inputs[2], money))
if int(money) <= 0:
res.append("Game Over.")
break
for i in range(len(res)):
print(res[i])
PAT (Basic Level) Practice (中文)1071 小赌怡情
最新推荐文章于 2024-09-03 18:29:17 发布