-
Notifications
You must be signed in to change notification settings - Fork 0
/
leap year.cpp
58 lines (50 loc) · 1.29 KB
/
leap year.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
#include<iostream>
#include<algorithm>
#include<cstring>
#include<cstdlib>
#include<string>
#include<cmath>
#include<iomanip>
typedef unsigned int ui;
typedef unsigned long int ul;
typedef unsigned long long int ull;
typedef long int li;
typedef long long int lli;
using namespace std;
main()
{
string y;
int x,mod4,mod100,mod400,mod15,mod55,l,i,ly,hf,bf;
bool n=false;
while(cin>>y)
{
bool f=false;
mod4=mod100=mod400=mod15=mod55=ly=hf=bf=0;
l=y.length();
for(i=0;i<l;i++)
{
x=y[i]-'0';
mod4=((mod4*10)+x)%4;
mod100=((mod100*10)+x)%100;
mod400=((mod400*10)+x)%400;
mod15=((mod15*10)+x)%15;
mod55=((mod55*10)+x)%55;
}
if(n==false)
n=true;
else
printf("\n");
if(mod4==0 && mod100!=0 || mod400==0)
{
printf("This is leap year.\n"),f=true;
if(mod55==0)
bf=1;
}
if(mod15==0)
printf("This is huluculu festival year.\n"),f=true;
if(bf==1)
printf("This is bulukulu festival year.\n"),f=true;
if(f==false)
printf("This is an ordinary year.\n");
}
}