![:)](./images/smilies/icon_smile.gif)
thank you brianfry713...
![:)](./images/smilies/icon_smile.gif)
Moderator: Board moderators
Code: Select all
#include<stdio.h>
#include<string.h>
char yearch[100000000];
int yearint[100000000];
int main()
{
int hulu, bulu, flg, line=0, add, temp, diff;
int d3, d4, d5, d11, d55;
int i, len, frst, lst, lstp;
while( scanf("%s",yearch) != EOF )
{
d5=1;
hulu=bulu=flg=0;
if(line)
printf("\n");
line=1;
len = strlen(yearch);
lstp=len-1;
lst=frst=0;
for( i=len-1;i>=0;i-- )
{
yearint[i]=yearch[i]-'0';
if( i==lstp ) {
lst=lst+yearint[i];
lstp=lstp-2;
}
else {
frst=frst+yearint[i];
}
}
add = frst+lst;
diff = lst-frst;
d3=add%3;
temp = yearint[len-1]+yearint[len-2]*10;
d4 = temp%4;
if( yearint[len-1]==0 || yearint[len-1]==5 )
d5=0;
d11 = diff%11;
if( d3==0 && d5==0 ) hulu=1;
if( d5==0 && d11==0 ) d55=0;
else d55=1;
if( yearint[len-1]=='0' && yearint[len-2]=='0' ) {
if( d4 == 0 ) {
flg++;
printf( "This is leap year.\n" );
if( d55==0 )
bulu=1;
}
}
else {
if( d4==0 ) {
flg++;
printf( "This is leap year.\n" );
if( d55==0 )
bulu=1;
}
}
if( hulu==1 ) {
flg++;
printf( "This is huluculu festival year.\n" );
}
if( bulu==1 ) {
flg++;
printf( "This is bulukulu festival year.\n" );
}
if( flg==0 )
printf("This is an ordinary year.\n");
}
}