您的位置:首页 > 其它

周赛问题 福州 A - Who is Older?

2013-11-18 22:14 387 查看
DescriptionJavaman and cpcs are arguing who is older. Write a program to help them.InputThere 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. Thei-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.OutputFor 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 n;cin>>n;while(n--){int a,b,c;int a1,b1,c1;cin>>a>>b>>c;cin>>a1>>b1>>c1;if(a>a1){cout<<"cpcs"<<endl;continue;}else if(a<a1){cout<<"javaman"<<endl;continue;}else{if(b>b1){cout<<"cpcs"<<endl;continue;}else if(b<b1){cout<<"javaman"<<endl;continue;}else{if(c>c1)cout<<"cpcs"<<endl;else if(c<c1){cout<<"javaman"<<endl;}elsecout<<"same"<<endl;}}}return 0;}
[/code]
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: