-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy path1078.cpp
61 lines (51 loc) · 1.1 KB
/
1078.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cstdio>
#include <vector>
#include <climits>
#include <cmath>
#include <set>
using namespace std;
#define ISYEAP(x) x % 100 != 0 && x % 4 == 0 || x % 400 == 0 ? 1 : 0
int dayOfMonth[13][2] =
{
{0,0},{31,31},{28,29},{31,31},{30,30},{31,31},
{30,30},{31,31},{31,31},{30,30},
{31,31},{30,30},{31,31}
}; //预存每月的
int main()
{
//freopen("in.txt","r",stdin);
int T,month,day;
int sumDay=0;
for(int i=1;i<10;i++)
{
sumDay+=dayOfMonth[i][ISYEAP(2006)];
}
sumDay+=21;
scanf("%d",&T);
while(T--)
{
scanf("%d %d",&month,&day);
int tmpDay=0;
for(int i=0;i<month;i++)
{
tmpDay+=dayOfMonth[i][ISYEAP(2006)];
}
tmpDay+=day;
if(tmpDay<sumDay)
{
printf("%d\n",sumDay-tmpDay);
}
else if(tmpDay==sumDay)
{
printf("It's today!!\n");
}
else
{
printf("What a pity, it has passed!\n");
}
}
return 0;
}//Parsed in 0.061 seconds