1071 小赌怡情

来源:互联网 发布:热化学数据库建库情况 编辑:程序博客网 时间:2024/04/30 20:03




#include <iostream>

using namespace std;

int main()
{
    int T,K;
    int n1[110],b[110],t[110],n2[110];
    cin>>T>>K;
    for(int i=0;i<K;i++){
        cin>>n1[i]>>b[i]>>t[i]>>n2[i];
    }
    for(int j=0;j<K;j++){
        if(T<=0){
            cout<<"Game Over."<<endl;
            break;
        }
        else{
            if(t[j]>T){
                cout<<"Not enough tokens.  Total = "<<T<<"."<<endl;
                continue;
            }
            if(b[j]==0&&n2[j]<n1[j]){
                T+=t[j];
                cout<<"Win "<<t[j]<<"!  Total = "<<T<<"."<<endl;
            }
            if(b[j]==0&&n2[j]>n1[j]){
                T-=t[j];
                cout<<"Lose "<<t[j]<<".  Total = "<<T<<"."<<endl;
            }
            if(b[j]==1&&n2[j]>n1[j]){
                T+=t[j];
                cout<<"Win "<<t[j]<<"!  Total = "<<T<<"."<<endl;
            }
            if(b[j]==1&&n2[j]<n1[j]){
                 T-=t[j];
                cout<<"Lose "<<t[j]<<".  Total = "<<T<<"."<<endl;
            }
        }
    }


    return 0;
}