ZOJ 3322Who is Older?
来源:互联网 发布:斑马梦龙网络进度计划 编辑:程序博客网 时间:2024/05/29 19:20
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
简单题,比大小#include<map>#include<cmath> #include<queue> #include<vector>#include<cstdio> #include<cstring> #include<algorithm> using namespace std;#define ms(x,y) memset(x,y,sizeof(x)) #define rep(i,j,k) for(int i=j;i<=k;i++) #define per(i,j,k) for(int i=j;i>=k;i--) #define loop(i,j,k) for (int i=j;i!=-1;i=k[i]) #define inone(x) scanf("%d",&x) #define intwo(x,y) scanf("%d%d",&x,&y) #define inthr(x,y,z) scanf("%d%d%d",&x,&y,&z) typedef long long LL;const int low(int x) { return x&-x; }const int mod = 1e9 + 7;const int N = 310;const int M = 1 << 14;int T, a[N], b[N];int check(){rep(i, 0, 2){if (a[i] == b[i]) continue;return a[i] < b[i] ? 1 : -1;}return 0;}int main(){for (inone(T); T--;){rep(i, 0, 2) inone(a[i]);rep(i, 0, 2) inone(b[i]);switch (check()){case 1:puts("javaman"); break;case 0:puts("same"); break;case -1:puts("cpcs"); break;default:break;}}return 0;}
Javaman and cpcs are arguing who is older. Write a program to help them.
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.
For each test case, output who is older in a single line. If they have the same birthday, output "same" (without quotes) instead.
31983 06 06 1984 05 021983 05 07 1980 02 291991 01 01 1991 01 01
javamancpcssame
简单题,比大小#include<map>#include<cmath> #include<queue> #include<vector>#include<cstdio> #include<cstring> #include<algorithm> using namespace std;#define ms(x,y) memset(x,y,sizeof(x)) #define rep(i,j,k) for(int i=j;i<=k;i++) #define per(i,j,k) for(int i=j;i>=k;i--) #define loop(i,j,k) for (int i=j;i!=-1;i=k[i]) #define inone(x) scanf("%d",&x) #define intwo(x,y) scanf("%d%d",&x,&y) #define inthr(x,y,z) scanf("%d%d%d",&x,&y,&z) typedef long long LL;const int low(int x) { return x&-x; }const int mod = 1e9 + 7;const int N = 310;const int M = 1 << 14;int T, a[N], b[N];int check(){rep(i, 0, 2){if (a[i] == b[i]) continue;return a[i] < b[i] ? 1 : -1;}return 0;}int main(){for (inone(T); T--;){rep(i, 0, 2) inone(a[i]);rep(i, 0, 2) inone(b[i]);switch (check()){case 1:puts("javaman"); break;case 0:puts("same"); break;case -1:puts("cpcs"); break;default:break;}}return 0;}
0 0
- ZOJ 3322 Who is Older?.
- ZOJ 3322Who is Older?
- ZOJ 3322 Who is Older?
- ZOJ 3322 Who is Older?
- ZOJ 3322Who is Older?
- ZOJ 3322Who is Older?(模拟)
- ZOJ 省赛题 Who is Older?
- ZOJ-3322-Who is Older?【7th浙江省赛】
- ZOJ 3333 Guess the Price 3323 Somali Pirates 3322 Who is Older?(超级水)
- ZOJ3322-Who is Older?
- A. Who is Older?
- 周赛问题 福州 A - Who is Older?
- zoj 3519 Who is the Smartest Man
- zoj 3519 Who is the Smartest Man
- 2014ACM集训13级PK赛2-Who is Older?
- The7th Zhejiang Provincial Collegiate Programming Contest->Problem A:A - Who is Older?
- The7th Zhejiang Provincial Collegiate Programming Contest->Problem A:A - Who is Older?
- ZOJ 3519 Who is the Smartest Man(贪心)
- Android广播机制总结
- 20170101
- mysql配置讲解:+密码重置+远程登陆+常规操作+备份与恢复+字符
- Eclipse添加DTD文件实现xml的自动提示功能
- 不需要jdk的eclipse
- ZOJ 3322Who is Older?
- sublime text3的打开Console ctrl+`快捷键不管用
- Tensorflow实例:利用LSTM预测股票每日最高价(一)
- 阿里巴巴日志处理系统
- 分时操作系统和实时操作系统
- 发送到 添加项
- ZOJ 3323Somali Pirates
- oracle11g客户端和pl/sql配置及使用(Windows系统)
- 学习、解决问题的奇招——看Demo