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
题目大意:曾经有一个游戏,一对恋人被迫用石头剪子布这个游戏来决定生死,输了的死。本来两个人决定同时出石头死去,但是最后关头,女生想要出剪子输掉,男生想要出包袱活下来,问最后谁会活下来。
#include<iostream> using namespace std; int main() { int t; cin>>t; string s1,s2,s3; while(t--) { cin>>s1>>s2>>s3; cout<<s2<<" "<<"will survive"<<endl; } return 0; }