周赛问题 福州 A - Who is Older?
2013-11-18 22:14
387 查看
DescriptionJavaman and cpcs are arguing who is older. Write a program to help them.InputThere 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. Thei-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.OutputFor 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 01Sample Output
javaman cpcs same
#include <iostream>using namespace std;int main(){int n;cin>>n;while(n--){int a,b,c;int a1,b1,c1;cin>>a>>b>>c;cin>>a1>>b1>>c1;if(a>a1){cout<<"cpcs"<<endl;continue;}else if(a<a1){cout<<"javaman"<<endl;continue;}else{if(b>b1){cout<<"cpcs"<<endl;continue;}else if(b<b1){cout<<"javaman"<<endl;continue;}else{if(c>c1)cout<<"cpcs"<<endl;else if(c<c1){cout<<"javaman"<<endl;}elsecout<<"same"<<endl;}}}return 0;}[/code]
相关文章推荐
- 周赛问题 福州 龟兔赛跑
- ZOJ 3322 Who is Older?
- 2014ACM集训13级PK赛2-Who is Older?
- uboot移植问题一:gcc is older than 6.0
- ZOJ 3322 Who is Older?(模拟)
- The7th Zhejiang Provincial Collegiate Programming Contest->Problem A:A - Who is Older?
- 周赛问题 福州 竞技游戏
- 周赛问题 福州 升降序列
- Who is Older?(水题)
- ZOJ-3322-Who is Older?【7th浙江省赛】
- ZOJ 3333 Guess the Price 3323 Somali Pirates 3322 Who is Older?(超级水)
- The7th Zhejiang Provincial Collegiate Programming Contest->Problem A:A - Who is Older?
- ZOJ3322-Who is Older?
- The7th Zhejiang Provincial Collegiate Programming Contest->Problem A:A - Who is Older?
- ZOJ 3322 Who is Older?.
- 周赛问题 福州 B - Somali Pirates
- ZOJ 省赛题 Who is Older?
- 周赛问题 福州 L - Guess the Price
- A. Who is Older?
- 周赛问题 福州 A - 代码问题