博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
[ACM_水题] Yet Another Story of Rock-paper-scissors [超水 剪刀石头布]
阅读量:5126 次
发布时间:2019-06-13

本文共 1924 字,大约阅读时间需要 6 分钟。

 

Description

Akihisa and Hideyoshi were lovers. They were sentenced to death by the FFF Inquisition. Ryou, the leader of the FFF Inquisition, promised that the winner of Rock-paper-scissors would be immune from the punishment. Being lovers, Akihisa and Hideyoshi decided to die together with their fists clenched, which indicated rocks in the game. However, at the last moment, Akihisa chose paper and Hideyoshi chose scissors. As a result, Akihisa was punished by the FFF Inquisition and Hideyoshi survived alone.

When a boy named b and a girl named g are being punished by the FFF Inquisition, they will play Rock-paper-scissors and the winner will survive. If there is a tie, then neither of they will survive. At first, they promise to choose the same gesture x. But actually, the boy wants to win and the girl wants to lose. Of course, neither of them knows that the other one may change his/her gesture. At last, who will survive?

Input

There are multiple test cases. The first line of input is an integer T ≈ 1000 indicating the number of test cases.

Each test case contains three strings -- bgx. All strings consist of letters and their lengths never exceed 20. The gesture x is always one of"rock""paper" and "scissors".

Output

If there is a tie, output "Nobody will survive". Otherwise, output "y will survive" where y is the name of the winner.

Sample Input

1Akihisa Hideyoshi rock

Sample Output

Hideyoshi will survive 题目大意:T种情况,A,B两人商量好同时出剪刀石头或布,结果A想赢,B想输,输出最终谁赢。 解题思路:B赢
1 #include
2 #include
3 #include
4 #include
5 using namespace std; 6 int main(){ 7 int T;cin>>T; 8 while(T--){ 9 string str1,str2,str3;10 cin>>str1>>str2>>str3;11 cout<
<<" will survive\n";12 }return 0;13 }
 

转载于:https://www.cnblogs.com/zjutlitao/p/3603552.html

你可能感兴趣的文章
linux-2.6.38 input子系统(用输入子系统实现按键操作)
查看>>
单点登录 之 OAuth
查看>>
Mysql 性能优化20个原则(2)
查看>>
Topshelf创建Windows服务
查看>>
steelray project viewer
查看>>
itext jsp页面打印
查看>>
HTTP之报文
查看>>
POJ 3225 - 区间
查看>>
Perl正则表达式匹配
查看>>
关闭弹出窗体,刷新父页面
查看>>
TCP三次握手(待细研究)
查看>>
【FICO 汇率】汇率
查看>>
css3制作滚动按钮
查看>>
正则表达式二探
查看>>
css用hover制作下拉菜单
查看>>
PL/SQL develper注册码,亲测有效
查看>>
2019/9/1
查看>>
2019/8/25日之债
查看>>
9/15的债
查看>>
centos7 安装docker
查看>>