[ACM_水题] Yet Another Story of Rock-paper-scissors [超水 剪刀石头布]

简介:


 

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

1
Akihisa Hideyoshi rock

Sample Output

Hideyoshi will survive

题目大意:T种情况,A,B两人商量好同时出剪刀石头或布,结果A想赢,B想输,输出最终谁赢。
解题思路:B赢

复制代码
 1 #include<iostream>
 2 #include<string.h>
 3 #include<cstring>
 4 #include<string>
 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<<str2<<" will survive\n";
12     }return 0;
13 }
复制代码


相关文章
|
7月前
|
算法
石头剪刀布 L1-044 稳赢 15分
石头剪刀布 L1-044 稳赢 15分
|
7月前
|
弹性计算 数据安全/隐私保护 Python
石头剪刀布
本场景介绍如何在阿里云ECS环境下用Python实现一款人机对战小游戏:石头剪刀布。
288 0
|
测试技术 Python
PTA 1018 锤子剪刀布 (20 分)
大家应该都会玩“锤子剪刀布”的游戏:两人同时给出手势,胜负规则如图所示
123 0
PAT刷题笔记-PAT乙1018-锤子剪刀布
PAT刷题笔记-PAT乙1018-锤子剪刀布
PAT刷题笔记-PAT乙1018-锤子剪刀布
|
存储 算法
PAT (Basic Level) Practice (中文) B1018. 锤子剪刀布
PAT (Basic Level) Practice (中文) B1018. 锤子剪刀布
97 0
PAT (Basic Level) Practice (中文) B1018. 锤子剪刀布
1018 锤子剪刀布 (20 分)(C++)
大家应该都会玩“锤子剪刀布”的游戏:两人同时给出手势,现给出两人的交锋记录,请统计双方的胜、平、负次数,并且给出双方分别出什么手势的胜算最大。
149 0
1018 锤子剪刀布 (20 分)(C++)
|
Java Go
HDU - 2018杭电ACM集训队单人排位赛 - 2 - Problem E. Travel
HDU - 2018杭电ACM集训队单人排位赛 - 2 - Problem E. Travel
97 0
|
Java
HDU - 2018杭电ACM集训队单人排位赛 - 3 - Problem F. Four-tuples
HDU - 2018杭电ACM集训队单人排位赛 - 3 - Problem F. Four-tuples
117 0
|
人工智能 Java
HDU - 2018杭电ACM集训队单人排位赛 - 2 - Problem C. Team Match
HDU - 2018杭电ACM集训队单人排位赛 - 2 - Problem C. Team Match
116 0

相关实验场景

更多