Octorber 21st

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 3688    Accepted Submission(s): 2268

Problem Description
HDU's 50th birthday, on Octorber 21st, is coming. What an exciting day!! As a student of HDU, I always want to know how many days are there between today and Octorber 21st.So, write a problem and tell me the answer.Of course, the date I give you is always in 2006.

 
Input
The input consists of T test cases. The number of T is given on the first line of the input file.Following T lines, which represent dates, one date per line. The format for a date is "month day" where month is a number between 1 (which indicates January) and 12 (which indicates December), day is a number between 1 and 31.All the date in the input are in 2006, you can assume that all the dates in the input are legal(合法).
 
Output
For each case, if the date is before Octorber 21st, you should print a number that between the date and Octorber 21st.If the day is beyond Octorber 21st, just print "What a pity, it has passed!".If the date is just Octorber 21st, print"It's today!!".
 
Sample Input
7
10 20
10 19
10 1
10 21
9 1
11 11
12 12
 
Sample Output
1
2
20
It's today!!
50
What a pity, it has passed!
What a pity, it has passed!
 
Author
8600
 
#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
int year[]={0,31,28,31,30,31,30,31,31,30,31,30,31};
int main()
{
int n,m,j,i,t,d;
scanf("%d",&t);
while(t--)
{
scanf("%d%d",&m,&d);
int sum=0;
if(m>10)
printf("What a pity, it has passed!\n");
else if(m==10&&d>21)
printf("What a pity, it has passed!\n");
else if(m==10&&d==21)
printf("It's today!!\n");
else if(m==10&&d<21)
printf("%d\n",21-d);
else
{
for(i=m;i<10;i++)
sum+=year[i];
sum+=21;
printf("%d\n",sum-d);
}
}
return 0;
}

  

hdu 1491 Octorber 21st的更多相关文章

  1. HDOJ(HDU) 1491 Octorber 21st

    Problem Description HDU's 50th birthday, on Octorber 21st, is coming. What an exciting day!! As a st ...

  2. Octorber 21st

    Octorber 21st Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Tot ...

  3. HDU 1498 50 years, 50 colors(最小点覆盖,坑称号)

    50 years, 50 colors Problem Description On Octorber 21st, HDU 50-year-celebration, 50-color balloons ...

  4. hdu 1498 50 years, 50 colors 最小点覆盖

    50 years, 50 colors Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Othe ...

  5. hdu 1498 50 years, 50 colors(二分匹配_匈牙利算法)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1498 50 years, 50 colors Time Limit: 2000/1000 MS (Ja ...

  6. 50 years, 50 colors HDU - 1498(最小点覆盖或者说最小顶点匹配)

    On Octorber 21st, HDU 50-year-celebration, 50-color balloons floating around the campus, it's so nic ...

  7. hdu 1498(最小点覆盖集)

    50 years, 50 colors Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Othe ...

  8. HDU——1498 50 years, 50 colors

    50 years, 50 colors Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Othe ...

  9. HDU——T 1498 50 years, 50 colors

    http://acm.hdu.edu.cn/showproblem.php?pid=1498 Time Limit: 2000/1000 MS (Java/Others)    Memory Limi ...

随机推荐

  1. http连接

    一.http over tcp over ip

  2. xp宿主机和VMware下Ubuntu12.04共享文件夹

    VMware下Windows与Linux共享文件的方法有很多,比如Samba等等,我这里介绍简单地通过设置VMware来达到共享的目的. 打开VMware的设置,在"options" ...

  3. Convert boolean values to strings 'Yes' or 'No'.

    Convert boolean values to strings 'Yes' or 'No'. Complete the bool_to_word (Javascript: boolToWord ) ...

  4. Spring事务Transaction配置的五种注入方式详解

    Spring事务Transaction配置的五种注入方式详解 前段时间对Spring的事务配置做了比较深入的研究,在此之间对Spring的事务配置虽说也配置过,但是一直没有一个清楚的认识.通过这次的学 ...

  5. 深入理解Java虚拟机 - 类加载器

    引子:       类加载器(classloader)是独立于虚拟机之外,可以独立实现的代码模块.     OSGi使用了类加载器的这一特点实现其热插拔的特性       Java同C++等语言不通, ...

  6. TreeList 实现多表头

    1. 先上图: 2. 再上代码: 原码

  7. 你真的精通Java吗?

    简历和自我介绍上经常能够读到“精通Java”这样的话,有人和我说,精通Java的人太多了,精通Java已经不能算亮点.不能给自己加分了.可是事实真是这样吗? 对于语言的学习,我有一种观点,一是纵向,即 ...

  8. 思考之spring的ioc

    控制反转 英语:Inversion of control,缩写为IoC 我想很多同学都会思考过这样的一个问题,控制反转,什么地方反转了,是不是翻译的不对? 这里插一句 当年马云借着盖茨的嘴说:“互联网 ...

  9. 【转】Eclipse配置Struts2问题:ClassNotFoundException: org...dispatcher.ng.filter.StrutsPrepareAndExecuteFilter

    我的解决方案 一开始,我是依照某本教材,配置了User Libraries(名为struts-2.2.3, 可供多个项目多次使用), 然后直接把struts-2.2.3引入过来(这个包不会真正的放在项 ...

  10. jQuery 属性操作 - val() 方法

    val() 方法返回或设置被选元素的值. 元素的值是通过 value 属性设置的.该方法大多用于 input 元素. 如果该方法未设置参数,则返回被选元素的当前值. <html> < ...