ZOJ 3322(A)
来源:互联网 发布:arm linux gcc 4.8.3 编辑:程序博客网 时间:2024/05/17 04:08
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
31983 06 06 1984 05 021983 05 07 1980 02 291991 01 01 1991 01 01
Sample Output
javamancpcssame
Author: CAO, Peng
Source: The 7th Zhejiang Provincial Collegiate Programming Contest
题意:谁更大?
题解:直接比较
#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;}
0 0
- ZOJ 3322(A)
- ZOJ 3202 (A)
- zoj 3798 Abs Problem( ZOJ Monthly, August 2014 - A)
- zoj 1000【a+b】
- ZOJ 1037 A - Gridland
- ZOJ 2965 模拟 (A)
- A - Applications ZOJ - 3705
- ZOJ - 3705 A - Applications
- ZOJ 4528 ZOJ Monthly, October 2011 A
- zoj 1763 A Simple Question of Chemistry(洪水!)
- zoj 2313 Chinese Girls' Amusement(2-A)
- zoj 3686 A Simple Tree Problem(dfs+线段树)
- HUT_ACM #1 A - Chinese Girls' Amusement(ZOJ 2313)
- ZOJ Problem Set - 1537(Playing with a Calculator)
- ZOJ 3686-A Simple Tree Problem (DFS+线段树)
- ZOJ 3810 A Volcanic Island(四色定理模板)
- ZOJ 3819Average Score (2014牡丹江现场赛A)
- zoj 3819(牡丹江现场赛A题)
- Binder学习指南
- 择业面对选择,嵌入式 or 互联网,该进哪个?
- Android中Activity传递参数至Fragment中
- UVALive 7152 Catering (有上下界的)费用流
- MySQL新建用户,授权,删除用户,修改密码操作
- ZOJ 3322(A)
- Android——Context的理解
- hdoj 1789 Doing Homework again
- FZU Problem 2227 邮票 (离散化+map+dfs)
- bzoj4542: [Hnoi2016]大数
- SwipeListView 详解 实现微信,QQ等滑动删除效果
- 关于JNI
- SQL SERVER常用函数
- 静态代码块 构造函数 静态代码块块执行顺序