Wednesday, 18 May 2011

10070-Leap Year or Not Leap Year and …

#include<iostream.h>
#include<stdio.h>
#include<string.h>
int main()
{
    long int i=0,j=0,n,k=0;
    while(scanf("%ld",&n)==1)
    {

        if((n%4==0&&n%100!=0)||n%400==0)
        {
            printf("This is leap year.\n");
            i=1;
        }
        if(n%15==0)
        {
            printf("This is huluculu festival year.\n");
            j=1;
        }
        if(n%55==0&&i==1)

        {
            printf("This is bulukulu festival year.\n");
            k=1;
        }
        if(i==0&&j==0&&k==0)
            printf("This is an ordinary year.\n");
        i=j=k=0;
                printf("\n");
    }
    return 0;
}

1 comment:

  1. This will not be accepted i think.
    What will be the output for 865756756227892375172800?

    You have to use string.

    Thanks.

    ReplyDelete