A - Who is Older?
Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%lld
& %llu
Submit Status Practice ZOJ
3322
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; }
时间: 2024-10-14 18:07:55