Page 16 of 16

Thanks

Posted: Fri Oct 10, 2014 6:45 pm
by gautamzero
thank u so much.. :D
i got AC now :D

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

Posted: Mon Jan 12, 2015 7:09 am
by uradura

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

Posted: Tue Jan 13, 2015 12:19 am
by brianfry713
Delete your post after you get AC.

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

Posted: Mon Jul 06, 2015 9:13 am
by liya
getting WA..i need help :

Code: Select all

#include<stdio.h>
int main()
{
    long long int i,j;
    while((scanf("%lld",&i))!=EOF)
    {
        if((i%4==0&&i%100!=0)||(i%400==0))
        {
            if(i%15==0&&i%55==0)
            {
                printf("This is leap year.\n");
                printf("This is huluculu festival year.\n");
                printf("This is buluculu festival year.\n");
            }
            else if(i%15==0&&i%55!=0)
            {
                printf("This is leap year.\n");
                printf("This is huluculu festival year.\n");
            }
            else if(i%55==0&&i%15!=0)
            {
                 printf("This is leap year.\n");
                printf("This is buluculu festival year.\n");
            }
            else
            {
                printf("This is leap year.\n");
            }
        }
        else
        {
            if(i%55==0&&i%15!=0)
            {
                printf("This is buluculu festival year.\n");
            }
            else if(i%55!=0&&i%15==0)
            {
                printf("This is huluculu festival year.\n");
            }
            else if(i%55==0&&i%15==0)
            {
                 printf("This is huluculu festival year.\n");
                  printf("This is buluculu festival year.\n");

            }
            else
            {
                printf("This is an ordinary year.\n");
            }
        }

    }
    return 0;
}

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

Posted: Fri Aug 21, 2015 4:35 am
by Helaluddin_brur
removed after ac

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

Posted: Sat Apr 09, 2016 5:15 pm
by mh_sagar
whats wrong with my code

Code: Select all

#include<stdio.h>

int main()
{
    int year;
    while(scanf("%d",&year)!=EOF){

    if(year<2000){
        printf("Year should be greater than 2000\n");
    }
    else{
        if(year%400==0 || (year%100!=0 && year%4==0)){
            printf("This is a leap year\n");
        }
        else{
            printf("This is a ordinary year\n");
        }
        if(year%15==0){
             printf("This is huluculu festival year\n");
        }
        if(year%55==0){
             printf("This is Bulukulu festival year\n");
        }
    }
    }
    return 0;
}

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

Posted: Sun Jun 12, 2016 1:53 pm
by monir004
Should i use string to solve this problem?

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

Posted: Thu Oct 06, 2016 10:46 am
by altair_ibn_la_ahad
I have gotten many many WAs. I have checked with almost all the inputs from uDebug and this forum and passed. But the judge think otherwise. I am unable to find any problem. Here is my code. Please help!

Code: Select all

#include <stdio.h>

int y[1000000];

int main() {
    char c;
    register int l = 0, div11 = 0, div3 = 0;
    while (c = getchar()) {
        if (c > 47 && c < 58) {
            int d = c - 48;
            y[l] = d;
            div3 += d;
            if ((l % 2) == 0) {
                div11 += d;
            } else {
                div11 -= d;
            }
            ++l;
        } else if (c == 10 || c == EOF) {
            int s = 0, ls = 0;
            if (((y[l - 4] * 10 + y[l - 3]) % 4 == 0) && (y[l - 2] == 0) && (y[l - 1] == 0)) {
                printf("This is leap year.\n");
                s = ls = 1;
            } else if ((y[l - 1] == 0) && (y[l - 2] == 0)) {
                s = 0, ls = 0;
            } else if ((y[l - 2] * 10 + y[l - 1]) % 4 == 0) {
                printf("This is leap year.\n");
                s = ls = 1;
            } else {
                s = 0, ls = 0;
            }
            if ((div3 % 3 == 0) && (y[l - 1] == 5 || y[l - 1] == 0)) {
                printf("This is huluculu festival year.\n");
                s = 1;
            }
            if (ls && (div11 % 11 == 0) && (y[l - 1] == 5 || y[l - 1] == 0)) {
                printf("This is bulukulu festival year.\n");
                s = 1;
            }
            if (!s)printf("This is an ordinary year.\n");
            if (c != EOF) {
                putchar(10);
            } else {
                break;
            }
            div3 = 0, div11 = 0, l = 0;
        }
    }
    return 0;
}

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

Posted: Tue Mar 14, 2017 1:59 pm
by lighted
Try running your code on the sample input. Your output doesn't match sample output.