Who is Older?(水题)

Who is Older?

Time Limit: 1 Second      Memory Limit: 32768 KB

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

 1 #include <iostream>
 2 #include <cstdio>
 3 
 4 using namespace std;
 5 
 6 int main()
 7 {
 8     int t, x[3], y[3], tag;
 9     cin >> t;
10     while(t--)
11     {
12         cin >> x[0] >> x[1] >> x[2] >> y[0] >> y[1] >> y[2];
13         if(x[0] > y[0]) tag = 1;
14         else if(x[0] < y[0]) tag = -1;
15         else
16         {
17             if(x[1] > y[1]) tag = 1;
18             else if(x[1] < y[1]) tag = -1;
19             else
20             {
21                 if(x[2] > y[2]) tag = 1;
22                 else if(x[2] < y[2]) tag = -1;
23                 else tag = 0;
24             }
25         }
26         if(tag > 0) puts("cpcs");
27         else if(tag < 0) puts("javaman");
28         else puts("same");
29     } 
30     return 0;
31 }

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值