http://acm.hdu.edu.cn/showproblem.php?pid=1491
无聊题
View Code
#include <stdio.h> int main() { int t,i; int month,day,now; int tab[11]={0,31,28,31,30,31,30,31,31,30}; scanf("%d",&t); while(t--) { scanf("%d%d",&month,&day); if(month>10||(month==10&&day>21)) puts("What a pity, it has passed!"); else if(month==10&&day==21) puts("It's today!!"); else { now=0; for(i=1;i<month;i++) now+=tab[i]; now+=day; printf("%d\n",294-now); } } return 0; }