মঙ্গলবার, ৩০ আগস্ট, ২০১৬

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

#include<stdio.h>
#include<string.h>
int main()
{
    char a[100000]={0};
    long v=0;
    while(scanf("%s",a)!=EOF)
    {
        if(v!=0)
        printf("\n");
        v=1;
        long i,l,b,s=0,e=0,f=0,g=0,h=0,p=0;
        l=strlen(a);
        for(i=0;i<l;i++)
        {
            b=s*10+a[i]-48;
            s=b%4;
            b=e*10+a[i]-48;
            e=b%100;
            b=f*10+a[i]-48;
            f=b%400;
            b=g*10+a[i]-48;
            g=b%15;
            b=h*10+a[i]-48;
            h=b%55;
        }
        if(s==0&&(e!=0||f==0))
        {
            p=1;
            printf("This is leap year.\n");
        }
        if(g==0)
        {
            p=1;
            printf("This is huluculu festival year.\n");
        }
        if((s==0&&(e!=0||f==0))&&h==0)
        {
            p=1;
            printf("This is bulukulu festival year.\n");
        }
        if(p==0)
        printf("This is an ordinary year.\n");
    }
    return 0;
}

কোন মন্তব্য নেই:

একটি মন্তব্য পোস্ট করুন

Factorization with prime Sieve

vector <int> prime; char sieve[1000009]; int N=1000009; void primeSieve ( ) { sieve[0] = sieve[1] = 1; prime.push_back(2); ...