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. android 在一个scrollView里面嵌套一个需要滑动的控件(listView、gridView)

    package cn.via.dageeeOrderFood.widget; import android.content.Context; import android.graphics.Point ...

  2. struts2总结五: Strut2 访问Servlet API

    一.间接访问 public String execute() throws Exception { this.message="hello,this is put into applicat ...

  3. linux下使用yum安装mysql、tomcat、httpd

    一.linux下使用yum安装mysql   1.安装 查看有没有安装过:           yum list installed mysql*           rpm -qa | grep m ...

  4. 最短路径算法之三——Bellman-Ford算法

    Bellman-Ford算法 Dijkstra算法无法判断含负权边的图的最短路. 如果遇到负权,在没有负权回路存在时,即便有负权的边,也可以采用Bellman-Ford算法正确求出最短路径. PS:负 ...

  5. Hadoop常用命令汇总

    启动Hadoop 进入HADOOP_HOME目录. 执行sh bin/start-all.sh 关闭Hadoop 进入HADOOP_HOME目录. 执行sh bin/stop-all.sh 1.查看指 ...

  6. dup和dup2函数以及管道的实现

    疑问:管道应该不是这样实现的,因为这要求修改程序的代码 dup和dup2也是两个非常有用的调用,它们的作用都是用来复制一个文件的描述符.它们经常用来重定向进程的stdin.stdout和stderr. ...

  7. [原]捉虫记3:_ConectionPtr指针调用open失败

    背景 产品使用MySQL来存储报警服务产生的报警.在报警服务的组件中使用ADO接口 客户方有两台计算机,一台计算机A用来组态,且可以对设备进行调试,操作系统是Win7 64bit 专业版,安装了VS2 ...

  8. Linux上程序执行的入口--Main

    main()函数,想必大家都不陌生了,从刚开始写程序的时候,大家便开始写main(),我们都知道main是程序的入口.那main作为一个函数,又是谁调用的它,它是怎么被调用的,返回给谁,返回的又是什么 ...

  9. 【HDOJ】4355 Party All the Time

    好久没做过三分的题目了. /* 4355 */ #include <iostream> #include <sstream> #include <string> # ...

  10. ListView使用CursorAdapter增加和删除item

    @Override protected void onCreate(Bundle savedInstanceState) { // TODO 自动生成的方法存根 super.onCreate(save ...