-
Notifications
You must be signed in to change notification settings - Fork 1
/
test4.cpp
102 lines (93 loc) · 2.14 KB
/
test4.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#include<stdio.h>
#include<string.h>
#include<string>
#include<iostream>
#define fread freopen("input.txt","r",stdin)
#define fwrite freopen("input.txt","w",stdout)
using namespace std;
int days[12]={31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30 ,31};
string months[12]={"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November" ,"December"};
bool isleap(int a)
{
if (a%400==0||(a%4==0 && a%100!=0))
return true;
return false;
}
int d,y;
string s;
int count()
{
int ret=0;
if ( y==0)
ret=0;
else ret=((y-1)/400)*97;
for (int i=0;i<=(y-1)%400;i++)
if (isleap(i))
ret++;
if (isleap(y))
{
if (!(s=="January" ||(s=="February" && d<29)))
ret++;
}
return ret;
}
bool gao()
{
if ((s=="February" && d==29))
return true;
return false;
}
int main()
{
#ifdef ENAM
// fread;
fwrite;
#endif // ENAM
int test=6;
cout<<test<<endl;
// for (int i = 0; i < test; ++i)
// {
// cout<<i+1<<endl;
// }
cout<<"10000"<<endl;
cout<<"11000"<<endl;
cout<<"11100"<<endl;
cout<<"11110"<<endl;
cout<<"11111"<<endl;
cout<<"21111"<<endl;
// scanf("%d",&test);
// int cas=1;
// while(test--)
// {
// cin>>s;
// scanf("%d,%d",&d,&y);
// int ans1=count();
// bool flag1=gao();
// cin>>s;
// scanf("%d,%d",&d,&y);
// int ans2=count();
// bool flag2=gao();
// int ans;
// if (ans1<ans2)
// {
// ans=ans2-ans1;
// if (flag1)
// ans++;
// }
// else if (ans2<ans1)
// {
// ans=ans1-ans2;
// if (flag2)
// ans++;
// }
// else if (ans2==ans1)
// {
// ans=0;
// if (flag1 || flag2)
// ans++;
// }
// //printf("$$$$$$ %d %d\n",ans1,ans2);
// printf("Case %d: %d\n",cas++,ans);
// }
return 0;
}