码迷,mamicode.com
首页 > 其他好文 > 详细

ZOJ 3322 Who is Older?

时间:2015-04-20 18:37:52      阅读:131      评论:0      收藏:0      [点我收藏+]

标签:最水题   zoj   入门   思维   

题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3322


题面:

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

题意:

    比谁老。还是比较欣赏自己率性的写法的技术分享


代码:

#include <iostream>
using namespace std;
int main()
{
	int t,y1,y2,m1,m2,d1,d2,x,xx;
	cin>>t;
	while(t--)
	{
		cin>>y1>>m1>>d1>>y2>>m2>>d2;
		x=y1*10000+m1*100+d1;
		xx=y2*10000+m2*100+d2;
		if(x<xx)cout<<"javaman\n";
		else if(x>xx)cout<<"cpcs\n";
		else cout<<"same\n";
	}
	return 0;
} 


ZOJ 3322 Who is Older?

标签:最水题   zoj   入门   思维   

原文地址:http://blog.csdn.net/david_jett/article/details/45151483

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!