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 sameAuthor: CAO, Peng
题意:谁更大?
题解:直接比较
#include<cstdio> #include<cstring> #include<cstdlib> #include<cmath> #include<iostream> #include<algorithm> #include<vector> #include<map> #include<set> #include<queue> #include<string> #include<bitset> #include<utility> #include<functional> #include<iomanip> #include<sstream> #include<ctime> using namespace std; #define N int(1e5) #define inf int(0x3f3f3f3f) #define mod int(1e9+7) typedef long long LL; #ifdef CDZSC #define debug(...) fprintf(stderr, __VA_ARGS__) #else #define debug(...) #endif int main() { #ifdef CDZSC freopen("i.txt", "r", stdin); //freopen("o.txt","w",stdout); int _time_jc = clock(); #endif pair<int, pair<int, int> >a[10]; int t; scanf("%d", &t); while (t--) { for (int i = 0; i < 2; i++) scanf("%d%d%d", &a[i].first, &a[i].second.first, &a[i].second.second); if (a[0] == a[1]) { puts("same"); } else if(a[0]<a[1]) { puts("javaman"); } else { puts("cpcs"); } } #ifdef CDZSC debug("time: %d\n", int(clock() - _time_jc)); #endif return 0; }