题源
题解
#include<stdio.h>
int T,K;
int n1,b,t,n2;
int main(){
scanf("%d %d",&T,&K);
int i = 0;
for(i = 0;i < K;i++){
scanf("%d %d %d %d",&n1,&b,&t,&n2);
if(t>T){printf("Not enough tokens. Total = %d.\n",T);continue;}
else{
if((n1>n2 && b==0)||(n1<n2 && b==1)){
T += t;
printf("Win %d! Total = %d.\n",t,T);
continue;
}
else{
T -= t;
printf("Lose %d. Total = %d.\n",t,T);
if(T<=0){printf("Game Over.\n");return 0;}
}
}
}
return 0;
}