省赛热身赛之——Yet Another Story of Rock-paper-scissors
来源:互联网 发布:图片表格识别软件 编辑:程序博客网 时间:2024/05/24 15:40
原题:
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 -- 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"
.
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
分析:
以前看过这样的故事——
说的是同样的情况,男孩不想让女孩死,先是两人都出了石头,结果最后男孩出了剪刀,女孩出了布。。。。。。。。。。这篇文章反了吧??????????
枚举,发现都是女孩胜利。
源码:
#include<stdio.h>int main(){ char a[300],b[300],c[200]; int n; scanf("%d",&n); while(n--) { scanf("%s%s%s",a,b,c); printf("%s will survive\n",b); } return 0;}
- 省赛热身赛之——Yet Another Story of Rock-paper-scissors
- Yet Another Story of Rock-paper-scissors
- zoj 3610 Yet Another Story of Rock-paper-scissors
- ZOJ 3610 Yet Another Story of Rock-paper-scissors
- K - Yet Another Story of Rock-paper-scissors
- ZOJ 3610 Yet Another Story of Rock-paper-scissors
- ZOJ 3610 Yet Another Story of Rock-paper-scissors
- Yet Another Story of Rock-paper-scissors(水题)
- ZOJ 3610 Yet Another Story of Rock-paper-scissors
- ZOJ 3610Yet Another Story of Rock-paper-scissors
- ZOJ3610-Yet Another Story of Rock-paper-scissors
- K. Yet Another Story of Rock-paper-scissors
- zoj 3610 Yet Another Story of Rock-paper-scissors 忽悠。。
- 2014ACM集训13级PK赛3-Yet Another Story of Rock-paper-scissors
- prepare for the provincial time --9.1-- Yet Another Story of Rock-paper-scissors
- hdu——Rock, Paper, Scissors
- 4952. Another Rock-Paper-Scissors Problem
- Sicily 4952. Another Rock-Paper-Scissors Problem
- 文本框相加运算
- [Uncle Bob Martin] Screaming Architecture
- 黄淮学院CSDN高校俱乐部巡讲
- 省赛热身赛之_Taxi Fare
- Tabhost中子Activity使用startActivityForResult后获取不到回调值问题的解决办法
- 省赛热身赛之——Yet Another Story of Rock-paper-scissors
- Python 的 and-or 技巧
- 委托----http://www.cnblogs.com/superpcer/archive/2011/06/06/2073751.html
- ExtJS 开发调试工具大全
- spring整合struts2方法及原理
- OSCHINA 联通代理节点的 Nginx 配置
- Sicily 1029 Rabbit
- 深入浅出插入类排序算法(直接插入, 折半插入, 希尔排序)
- struts2 防止表单重复提交