ZOJ 3322 Who is Older?
来源:互联网 发布:淘宝内部优惠券推广员 编辑:程序博客网 时间:2024/06/05 04:12
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3322
题面:
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 <iostream>using namespace std;int main(){int t,y1,y2,m1,m2,d1,d2,x,xx;cin>>t;while(t--){cin>>y1>>m1>>d1>>y2>>m2>>d2;x=y1*10000+m1*100+d1;xx=y2*10000+m2*100+d2;if(x<xx)cout<<"javaman\n";else if(x>xx)cout<<"cpcs\n";else cout<<"same\n";}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(贪心)
- ODL开发学习笔记@北邮-Kobe
- Android任务和返回栈完全解析,细数那些你所不知道的细节
- 正则表达式
- Scala讲座:类定义和构造函数
- 常用的正则表达式及jQuery.validator运用正则验证
- ZOJ 3322 Who is Older?
- 无法启动此程序,因为计算机中丢失MSVCP120D.dll
- js各种框架和主要用途方向.
- java中的url 编码与解码
- 关于类的结构图
- 5亿个数找中位数
- python学习之--Django--Get and Post
- 求解字符串间最短距离(字符串相似度)
- hihoCoder hiho一下 第四十二周:骨牌覆盖问题·二