1019石头、剪刀、布
2013-12-16 17:56
295 查看
#include <iostream> using namespace std; int main() { int t; cin>>t; int a,b,n; char c1,c2; for(int i=0;i<t;i++) { a=0; b=0; cin>>n; for(int j=0;j<n;j++) { cin>>c1>>c2; if(c1=='R') { if(c2=='S') a++; else if(c2=='P') b++; else if(c2=='R') { a++; b++; } } else if(c1=='P') { if(c2=='R') a++; else if(c2=='S') b++; else if(c2=='p') { a++; b++; } } else if(c1=='S') { if(c2=='P') a++; else if(c2=='R') b++; else if(c2=='S') { a++; b++; } } } if(a>b) { cout<<"Player 1"<<endl; } else if(a<b) {cout<<"Player 2"<<endl; } else if (a==b) { cout<<"TIE"<<endl; } } return 0; }
相关文章推荐
- 剪刀、石头、布机器人比赛
- BZOJ 2597 [Wc2007]剪刀石头布
- 【BZOJ】【P2597】【Wc2007】【剪刀石头布】【题解】【费用流】
- 8,石头,剪刀,布的逻辑代码
- java基础总结 --- enum枚举实现多路分发 石头、剪刀、布游戏示例
- c#游戏 剪刀石头
- 16_矩阵剪刀石头布
- 剪刀石头布
- BZOJ2597 [Wc2007]剪刀石头布 【费用流】
- 石头-剪刀-布
- 剪刀、石头、布游戏
- 算法练习-模拟石头、剪刀、布
- (Rock, Paper, Scissors, Lizard and Spock)sheldon谢耳朵独创的剪刀,布,石头,蜥蜴,史波克 用代码实现
- 石头,剪刀,布游戏
- 2-sat(石头、剪刀、布)hdu4115
- 面向对象剪刀石头布小游戏的制作
- 石头-剪刀-布
- [Wc2007]剪刀石头布
- Python 剪刀石头布
- 剪刀、石头、布游戏