1195 -- Good luck and have fun
来源:互联网 发布:谷歌学术镜像 知乎 编辑:程序博客网 时间:2024/04/29 20:09
Good luck and have fun
Time Limit:1000MS Memory Limit:65536K
Total Submit:122 Accepted:25
Description
欢迎参加安科ACM校内赛!作为一名经历了好几届校赛的ACM老队员以及本次校赛的出题人,每次校赛都让我有一种全新的感受——有第一次参加校赛时提交代码时紧张到双手发抖,也有当裁判时看到有些不明真相的人提交编译后程序时的欢乐。不管你是第几次参赛,好好享受这一刻带给你的各种感受,经历就是一种财富。为了让大家更好地记住这悲喜交加的日子,特意准备了这么一道题:
给你一个日期,你只要输出这个日期是在校赛前还是校赛后,或者刚好就是校赛那一天(2014年4月20号)。
题目是什么意思呢?Good luck and have fun,祝大家在本次校赛取得好成绩!
Input
输入数据的第一行是一个正整数T(0 < T <= 100),表示有T组测试数据。
每组测试数据只有一行,为三个数字Y,M,D(0 < Y <= 10000, 0 < M <= 12, 0 < D <= 31),表示Y年M月D号。日期符合现实日期规范。
Output
对于每组测试数据,在一行上输出一个字符串:如果在校赛日前之前,则输出"before";如果在校赛日期之后,则输出"after";如果刚好是校赛那天,则输出"nice day"。
Sample Input
32000 2 292014 4 202111 11 11
Sample Output
beforenice dayafter
Hint
注意,此题多组测试数据,即while(cin>>T){......}
Source
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace AK1195 { class Program { static void Main(string[] args) { string sb; while ((sb = Console.ReadLine()) != null) { int n = int.Parse(sb); while (n-- > 0) { string[] s = Console.ReadLine().Split(); int y = int.Parse(s[0]), m = int.Parse(s[1]), d = int.Parse(s[2]); if (y == 2014 && m == 4 && d == 20) Console.WriteLine("nice day"); else if (y < 2014 || (y == 2014 && m < 4) || (y == 2014 && m == 4 && d < 20)) Console.WriteLine("before"); else Console.WriteLine("after"); } } } }}
0 0
- akoj-1195-Good luck and have fun
- 1195 -- Good luck and have fun
- !!! Good luck & have fun !!!
- Linux Is Not Matrix番外篇——good luck have fun
- good luck
- Have Fun & Have Busy
- Good luck 2011!!
- Good Luck! 2014
- Code Jam--Good Luck
- New world,Good luck!
- My colleagues and have a good and big meal tonight...
- Good luck to my brother
- Good luck to myself ^_^
- TAP---资料整合----Good Luck!
- Have a fun
- Have Fun with Numbers
- Have Fun with Numbers
- have tons of fun
- 1194 -- 爱走楼梯的小胖
- 维护x的秩
- 关于if语句,关于try-catch不得不说的思考
- UE4 Command-Line Arguments
- Log4j学习
- 1195 -- Good luck and have fun
- pidof
- 1196 -- S1+S2
- Android-本地方法与Java相互调用-自定义ProgressBar(锅炉压力监测例子)/NDK-JNI开发实例(七)
- 常用函数
- android LinearLayout设置selector不起作用解决
- http 请求获取页面内容
- 1197 -- 曹冲称象
- Android APK反编译就这么简单 详解(附图)