ZCMU新人训练赛K
2017-08-02 10:02
204 查看
K - Yet Another Story of Rock-paper-scissors
ZOJ- 3610 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 decidedto 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 choosethe 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?InputThere 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 -- b g x. All strings consist of letters and their lengths never exceed 20. The gesture x is always one of"rock",
"paper"and
"scissors".<h4< dd="">OutputIf there is a tie, output
"Nobody will survive". Otherwise, output
"y will survive"wherey is the name of the winner.<h4< dd="">Sample Input
1 Akihisa Hideyoshi rockSample Output
Hideyoshi will survive
AC代码:
#include<iostream>#include<string.h>#include<cstring>#include<stdio.h>#include<string>using namespace std;int main(){ int t; scanf("%d",&t); while(t--) { string b,g,x; cin>>b>>g>>x; cout<<g<<" will survive"<<endl; } return 0;}
相关文章推荐
- ZCMU新人训练赛A
- ZCMU新人训练赛B
- ZCMU新人训练赛A
- ZCMU新人训练赛B
- ZCMU新人训练赛F
- ZCMU新人训练赛J
- ZCMU新人训练赛I
- ZCMU新人训练赛A
- ZCMU新人训练赛J
- ZCMU-训练赛-Primary Arithmetic
- ZCMU-训练赛-Problem A: Freckles
- ZCMU-训练赛-A
- 第五周训练赛2--B题
- HUNAN 2014 暑期培训训练赛之十二 F题 (线段树)
- 新人求罩
- 我的助理辞职了!——值得职场新人一看(转)
- 为什么写技术博客对新人如此重要?
- 新人报道下
- 职场新人面试误区:我的技术好,所以你必须要请我?
- LaTeX新人教程,30分钟从完全陌生到基本入门