-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path10070a.cpp
63 lines (57 loc) · 1.13 KB
/
10070a.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
#include<stdio.h>
#include<string.h>
#define MAX 5000
int call_div(char number[],int div)
{
int len=strlen(number);
int now;
int extra=0;
for(now=0;now<len;now++)
{
extra=extra*10+(number[now]-'0');
extra=extra%div;
}
return extra;
}
int main()
{
int t=0;
char year[MAX];
while(scanf("%s",year)!=EOF)
{
if(t>0)
printf("\n");
t=1;
if(call_div(year,400)==0)
{
printf("This is leap year.\n");
if(call_div(year,15)==0)
printf("This is huluculu festival year.\n");
if(call_div(year,55)==0)
printf("This is bulukulu festival year.\n");
//printf("\n");
}
else
{
int p=0;
if(call_div(year,4)==0&&call_div(year,100)!=0)
{
printf("This is leap year.\n");
if(call_div(year,15)==0)
printf("This is huluculu festival year.\n");
if(call_div(year,55)==0)
printf("This is bulukulu festival year.\n");
p=1;
}
if(call_div(year,15)==0&&p==0)
{
p=1;
printf("This is huluculu festival year.\n");
}
if(p==0)
printf("This is an ordinary year.\n");
//printf("\n");
}
}
return 0;
}