Advertisement
Guest User

Untitled

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