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;
}
- 1071 小赌怡情
- PAT乙级 1071 小赌怡情
- 1071. 小赌怡情
- 1071. 小赌怡情(15)
- 1071. 小赌怡情(15)
- 1071. 小赌怡情(15)
- 1071. 小赌怡情(15)
- 1071. 小赌怡情(15)
- 1071. 小赌怡情(15)
- 1071. 小赌怡情(15)
- PAT 1071.小赌怡情
- 1071. 小赌怡情(15)
- 1071. 小赌怡情(15)
- 1071. 小赌怡情(15)
- 1071. 小赌怡情(15)
- 1071. 小赌怡情(15)
- 1071. 小赌怡情(15)
- 1071. 小赌怡情(15)
- swift4初探之网络请求
- usaco Friday the Thirteenth
- 上机练习2 类与对象
- 1-9:MysqL--合计函数-count
- (POJ
- 1071 小赌怡情
- 自然语言---哈夫曼树
- Non-overlapping Intervals问题及解法
- Mybatis sql 转义字符
- web原生接口获取手机或笔记本电量
- gcc File format not recognized 问题的解决
- C#&&UnityEngine:Intelface接口的简单实现
- C# 打印详解
- 排序