1071 小赌怡情 (15 分)
#include <iostream>
using namespace std;
int main()
{int T, K, n1, n2, b, t;cin>>T>>K;for (int i = 0; i < K; i++) {cin>>n1>>b>>t>>n2;int ans = n1 > n2 ? 0 : 1;if (T == 0)//输光筹码 {printf("Game Over.\n");return 0;//注意 } else if (t > T)//下注的筹码大于已有的筹码 {printf("Not enough tokens. Total = %d.\n", T);}else if (ans == b)//如果赌对了 {T += t;printf("Win %d! Total = %d.\n", t, T);} else if (ans != b) //如果下注输了 {T -= t;printf("Lose %d. Total = %d.\n", t, T);} }return 0;
}