10070 - Leap Year or Not Leap Year and ...

#include<stdio.h>
#include<string.h>
char str[1000000];
int main()
{
    int len,i,rem,rem1,rem2,rem3,rem4;
    int count=0;
    while(scanf("%s",str)==1)
    {
        len=strlen(str);
        rem=0;
        rem1=0;
        rem2=0;
        rem3=0;
        rem4=0;
        for(i=0; i<len; i++)
        {
            rem=((rem*10)+(str[i]-48))%4;
            rem1=((rem1*10)+(str[i]-48))%100;
            rem2=((rem2*10)+(str[i]-48))%400;
            rem3=((rem3*10)+(str[i]-48))%15;
            rem4=((rem4*10)+(str[i]-48))%55;
        }
        if(count==1)
        {
            printf("\n");
        }
        count=1;
        if((rem==0&&rem1!=0)||rem2==0)
        {
            printf("This is leap year.\n");
            if(rem3==0)
            {
                printf("This is huluculu festival year.\n");
            }
            if(rem4==0)
            {
                printf("This is bulukulu festival year.\n");
            }
        }
        else
        {
            if(rem3==0)
            {
                printf("This is huluculu festival year.\n");
            }
            else
            {
                printf("This is an ordinary year.\n");
            }
        }
    }
    return 0;
}

0 comments: (+add yours?)