ZOJ3322-Who is Older?
来源:互联网 发布:java 字符串 == 编辑:程序博客网 时间:2024/05/18 03:52
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
题意:告诉你两个人的出生日期,问两个人谁更大,一样则输出same
#include <iostream>#include <cstdio>using namespace std;#define LL long longconst int INF=0x3f3f3f3f;const int MAX=100009;int y1,y2,d1,d2,r1,r2;int main(){ int t; scanf("%d",&t); while(t--) { scanf("%d %d %d %d %d %d",&y1,&d1,&r1,&y2,&d2,&r2); if(y1==y2&&d1==d2&&r1==r2) printf("same\n"); else if(y1==y2) { if(d1==d2) { if(r1>r2) printf("cpcs\n"); else printf("javaman\n"); } else { if(d1>d2) printf("cpcs\n"); else printf("javaman\n"); } } else if(y1>y2) printf("cpcs\n"); else printf("javaman\n"); } return 0;}
0 0
- ZOJ3322-Who is Older?
- A. Who is Older?
- ZOJ 省赛题 Who is Older?
- 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?(模拟)
- 周赛问题 福州 A - Who is Older?
- ZOJ-3322-Who is Older?【7th浙江省赛】
- 2014ACM集训13级PK赛2-Who is Older?
- ZOJ 3333 Guess the Price 3323 Somali Pirates 3322 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?
- Who is Who
- Who is !
- [水]ZOJ3322
- 史上最简单的 MyBatis 教程(四)
- WIN10 SDKmanager无法打开解决方法
- scrollview嵌套listview或者GridView大小不确定
- Android的开源项目总结( 一 )
- spring JDBC
- ZOJ3322-Who is Older?
- vim 常用命令
- 欢迎使用CSDN-markdown编辑器
- 不要怂,就是GAN (生成式对抗网络) (四):训练和测试 GAN
- 过滤器和拦截器的区别
- 10006---临时急需马上说-01
- MySQL中锁详解(行锁、表锁、页锁、悲观锁、乐观锁等)
- sphinx学习技巧:亿万级项目都在用的sphinx
- Visual Studio常用快捷键