noshin98

uva 10070

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