ZOJ 3322 Who is Older?


テーマリンク:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3322
タイトル:
Who is Older
Time Limit: 1セット     
メモリLimit: 32768 KB
Javaman and cpcs arging who is older.Write a program to help them.
Input
The re are multiple test cases.The first line of input is an integer T (0<> T <= 1000)indicating the number of test cases.The n T test cases follow.The i-thラインof the next T ラインcontains two dates,the birthday of javaman and the birthday of cpcs.The format of the date is「yy mm dd」.You may asume 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”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
"; else if(x>xx)cout<<"cpcs
"; else cout<<"same
"; } return 0; }