Advertisement
Guest User

Untitled

a guest
Jul 24th, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.14 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<string.h>
  3. int main()
  4. {
  5.     char a[10000];
  6.     int flag = 0;
  7.     while(gets(a))
  8.     {
  9.         fflush(stdin);
  10.         if(flag)
  11.             printf("\n");
  12.         flag = 1;
  13.         int i=0,j=0,k=0,l,n=0,p=0,s,flag=0;
  14.         int q=0,w=0;
  15.         l=strlen(a)-1;
  16.         for(s=0; s<=l; s++)
  17.         {
  18.             i=(i*10+a[s]-48)%400;
  19.             j=(j*10+a[s]-48)%100;
  20.             k=(k*10+a[s]-48)%4;
  21.             n=(n*10+a[s]-48)%15;
  22.             p=(p*10+a[s]-48)%55;
  23.         }
  24.  
  25.  
  26.  
  27.         if(i==0)
  28.         {
  29.             printf("This is leap year.\n");
  30.             q=1;
  31.             flag=1;
  32.         }
  33.         else if(j==0);
  34.         else if(k==0)
  35.         {
  36.             printf("This is leap year.\n");
  37.             q=1;
  38.             flag=1;
  39.         }
  40.  
  41.         if(n==0)
  42.         {
  43.             printf("This is huluculu festival year.\n");
  44.             w=1;
  45.             flag=1;
  46.         }
  47.         if(q==1&&p==0)
  48.         {
  49.             printf("This is bulukulu festival year.\n");
  50.  
  51.             flag=1;
  52.         }
  53.         if(flag==0)
  54.             printf("This is an ordinary year.\n");
  55.     }
  56.     return 0;
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement