FZU 2054 拳王
2013-11-22 13:51
274 查看
题意:
拳王是一款街机游戏。从1997到2005一共九款,是格斗游戏。
现在A,B双方各选3个英雄进行对打。假设每个英雄都有一个能力值,且各不相同。能力高的英雄肯定能打败能力低的英雄。请问最后哪一方能赢。
第一行一个整数T(1<T<20),表示A,B双方进行了T场比赛。
接下来T行每行六个整数,前三个数表示A方选的英雄的能力,后三个数表示B方选的英雄的能力。
对于每组数据,如果A方获胜输出1,否则输出2。
21 2 3 0 0 46 5 4 3 2 1
21
Problem Description
拳王是一款街机游戏。从1997到2005一共九款,是格斗游戏。现在A,B双方各选3个英雄进行对打。假设每个英雄都有一个能力值,且各不相同。能力高的英雄肯定能打败能力低的英雄。请问最后哪一方能赢。
Input
第一行一个整数T(1<T<20),表示A,B双方进行了T场比赛。接下来T行每行六个整数,前三个数表示A方选的英雄的能力,后三个数表示B方选的英雄的能力。
Output
对于每组数据,如果A方获胜输出1,否则输出2。
Sample Input
21 2 3 0 0 46 5 4 3 2 1
Sample Output
21#include <iostream> #include <cstdio> #include <cstring> #include <algorithm> using namespace std; int main(){ int t; scanf("%d",&t); while (t--){ int a=-1,b=-1,c; for (int i = 0; i < 3; i++){ scanf("%d",&c); a = max(a,c); } for (int i = 0; i < 3; i++){ scanf("%d",&c); b = max(b,c); } if (a > b) printf("1\n"); else printf("2\n"); } return 0; }
相关文章推荐
- C# IL 指令集
- /etc/sysconfig/的文件
- Zookeeper与paxos算法
- C#实现APK自动打包
- 每天读一遍,慢慢的你就变了
- Gerrit 系统初探
- reference引用和return address类型
- We Recommend a Singular Value Decomposition
- 我在阿里云玩蟹科技分享篇
- JavaScript中的对象与构造器
- Linux内存映射(mmap)简析
- c# web gridview checkbox 应用
- Could not load type 'System.Runtime.CompilerServices.ExtensionAttribute' from assembly 'mscorlib, V
- 读《设计模式解析》
- servlet生成验证码
- 再谈windows下几个重要的DOS命令和命令组合,工作中常用
- 微软正式发布Windows 1.0 回顾历代Windows版本界面
- 当Selenium遇到TestNG
- android通过USB使用真机调试程序(转)
- XE5 Android 手机端中文显示乱码问题