-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path10070 maybe alternative of big integer.cpp
98 lines (94 loc) · 2.18 KB
/
10070 maybe alternative of big integer.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
#include<bits/stdc++.h>
using namespace std;
int cases,a,b,i,j,res,len,flag=0;
char A[900000];
int isleap(char S[]){
int p=0,tmp=0,a=1;
for(i=0;i<len;i++){
tmp = (tmp*a) + (S[i]-48);
a=10;
tmp =(tmp%4);
//printf("%d\n",tmp);
}
if(tmp==0){
//printf("asd\n");
a=1;
for(i=0;i<len;i++){
tmp = (S[i]-48) + (tmp*a);
a=10;
tmp = (tmp%100);
}
if(tmp==0){
a=1;
//printf("dhuks");
for(i=0;i<len;i++){
tmp = (S[i]-48) + (tmp*a);
a=10;
tmp = (tmp%400);
}
if(tmp==0)return 1;
else{
return 0;
}
}
else{
return 1;
}
}
}
int hul(char S[]){
int p=0,tmp=0,a=1;
for(i=0;i<len;i++){
tmp = (tmp*a) + (S[i]-48);
a=10;
tmp = (tmp%15);
//printf("%d\n",tmp);
}
if(tmp==0)return 1;
else{
return 0;
}
}
int bul(char S[]){
int p=0,tmp=0,a=1;
for(i=0;i<len;i++){
tmp = (tmp*a) + (S[i]-48);
a=10;
tmp = (tmp%55);
//printf("%d\n",tmp);
}
if(tmp==0)return 1;
else{
return 0;
}
}
int main(){
//freopen("input.txt","r",stdin);
//freopen("output.txt","w",stdout);
while(scanf("%s",A)!=EOF){
//printf("%s\n",A);
if(flag>0){
printf("\n");
}
flag++;
len=strlen(A);
int a=isleap(A);
int h=hul(A);
int b=bul(A);
if(a==1){
printf("This is leap year.\n");
if(h==1){
printf("This is huluculu festival year.\n");
}
if(b==1){
printf("This is bulukulu festival year.\n");
}
}
else if( h==1){
printf("This is huluculu festival year.\n");
}
else{
printf("This is an ordinary year.\n");
}
}
}