您的位置:首页 > 其它

FZU 2054 拳王

2013-11-22 13:51 274 查看
题意:



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;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: