首页 > 其他 > 详细

ZOJ 3322 Who is Older?

时间:2015-04-18 10:06:32      阅读:107      评论:0      收藏:0      [点我收藏+]

A - Who is Older?
Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%lld & %llu

Description

Javaman and cpcs are arguing who is older. Write a program to help them.

Input

There are multiple test cases. The first line of input is an integer T (0 < T <= 1000) indicating the number of test cases. Then T test cases follow. The i-th line of the next T lines contains two dates, the birthday of javaman and the birthday of cpcs. The format of the date is "yyyy mm dd". You may assume the birthdays are both valid.

Output

For each test case, output who is older in a single line. If they have the same birthday, output "same" (without quotes) instead.

Sample Input

3
1983 06 06 1984 05 02
1983 05 07 1980 02 29
1991 01 01 1991 01 01

Sample Output

javaman
cpcs
same

水题,

直接比较。

#include <cstdio>
#include <algorithm>
#include <map>
#include <cstring>
#include <cmath>
#include <iostream>
using namespace std;
#define lson l , m , rt << 1
#define rson m + 1 , r , rt << 1 | 1
#define LL __int64
typedef long long ll;
#define PI 3.1415926
int main()
{
    int a,b,c;
    int a1,b1,c1;
    int t;
    cin>>t;
    while(t--)
    {
        cin>>a>>b>>c;
        cin>>a1>>b1>>c1;
        int flag=0;
        if(a>a1)
        {
               cout<<"cpcs"<<endl;
               continue;
        }
        if(a<a1)
        {
            cout<<"javaman"<<endl;
            continue;
        }
            if(b>b1)
        {
               cout<<"cpcs"<<endl;
               continue;
        }
        if(b<b1)
        {
            cout<<"javaman"<<endl;
            continue;
        }
              if(c>c1)
        {
               cout<<"cpcs"<<endl;
               continue;
        }
        if(c<c1)
        {
            cout<<"javaman"<<endl;
            continue;
        }
        cout<<"same"<<endl;
    }
    return 0;
}


ZOJ 3322 Who is Older?

原文:http://blog.csdn.net/sky_miange/article/details/45110457

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!