money, n = map(int, input().split()) for _ in range(n): #money为0的判断放在输入前,否则测试点4不过,应考虑玩家一开始的筹码为0的情况 if money == 0: print('Game Over.') break info = list(map(int, input().split())) # if money == 0: #错误写法 # print('Game Over.') # break if info[2] > money: print('Not enough tokens. Total = ' + str(money) + '.') elif (info[0] < info[-1] and info[1] == 1) or (info[0] > info[-1] and info[1] == 0): money += info[2] print("Win "+ str(info[2]) + '! Total = ' + str(money) + '.') else: money -= info[2] print("Lose " + str(info[2]) + ". Total = " + str(money) + '.')
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)