1071 小赌怡情 较简单

include

include

using namespace std;
int main()
{
int T,k;
int n1,b,t,n2;
cin>>T>>k;
for(int i=0;i<k;i++){
cin>>n1>>b>>t>>n2;
if(t>T){
cout<<"Not enough tokens. Total = "<<T<<"."<<endl;
continue;
}
if(int(n1<n2)==b){
T+=t;
cout<<"Win "<<t<<"! Total = "<<T<<"."<<endl;
}
else{
T-=t;
cout<<"Lose "<<t<<". Total = "<<T<<"."<<endl;
if(T<=0){
cout<<"Game Over.";
break;
}
}
}
return 0;
}

posted @ 2022-07-12 11:21  qwasdasd  阅读(12)  评论(0)    收藏  举报