ZCMU新人训练赛K
来源:互联网 发布:m1头盔淘宝 编辑:程序博客网 时间:2024/06/01 10:37
K - Yet Another Story of Rock-paper-scissors
ZOJ - 3610Akihisa 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?
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"
.
If there is a tie, output "Nobody will survive"
. Otherwise, output "y will survive"
wherey is the name of the winner.
1Akihisa Hideyoshi rock
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新人训练赛K
- ZCMU新人训练赛A
- ZCMU新人训练赛J
- ZCMU新人训练赛A
- ZCMU新人训练赛A
- ZCMU新人训练赛B
- ZCMU新人训练赛F
- ZCMU新人训练赛I
- ZCMU新人训练赛J
- ZCMU新人训练赛B
- ZCMU-训练赛-A
- ZCMU-训练赛-Primary Arithmetic
- ZCMU-训练赛-Problem A: Freckles
- ZCMU—K
- zcmu 1540: 第k大数
- ZCMU-1812-K好数
- zzuli训练赛_05_13-K
- ZCMU-1305-第K完美序列
- 依赖注入到底是什么概念
- 如何在java程序中调用linux命令或者shell脚本
- linux内核分析笔记----内存管理
- leetcode--2. Add Two Numbers
- WebView加载富文本(解决富文本内部图片不能加载,一直闪屏问题)的方法
- ZCMU新人训练赛K
- 变量作用域
- MINI-RNN代码学习
- 机器学习实战:python算法代码汇总
- CHECKBOX
- jquery实现点击步骤条变色,以及点击下一步变色
- C++中的CFile操作详解
- 1. 深度学习过往
- 程序和美丽的图形界面