#include <iostream>
using namespace std;
int main() {
int total,round;
int first, choose, put, second;
cin >> total >> round;
while (round--) {
cin >> first >> choose >> put >> second;
if (put > total) {
printf("Not enough tokens. Total = %d.\n", total);
continue;
}
if (choose == (first < second)) {
total += put;
printf("Win %d! Total = %d.\n",put,total);
}
else {
total -= put;
printf("Lose %d. Total = %d.\n", put, total);
}
if (total <= 0) {
cout<<"Game Over."<<endl;
break;
}
}
return 0;
}
PAT乙级1071
最新推荐文章于 2024-06-26 20:17:52 发布