Guest

Leap year or not leap year

By: a guest on Jan 28th, 2012  |  syntax: None  |  size: 0.52 KB  |  hits: 15  |  expires: Never
download  |  raw  |  embed  |  report abuse
Copied
  1. #include<stdio.h>
  2. int main()
  3. {
  4.         int c, l;
  5.         long long int year;
  6.         while (scanf("%lld",&year)==1)
  7.         {
  8.                 l = 0;
  9.                 c = 1;
  10.                 if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)
  11.                 {
  12.                         printf("This is leap year.\n");
  13.                         c = 0;
  14.                         l = 1;
  15.                 }
  16.                 if (year % 15 == 0)
  17.                 {
  18.                         printf("This is huluculu festival year.\n");
  19.                         c = 0;
  20.                 }
  21.                 if (year % 55 == 0 && l)
  22.                 {
  23.                         printf("This is bulukulu festival year.\n");
  24.                         c = 0;
  25.                 }
  26.                 if (c)
  27.                         printf("This is an ordinary year.\n");
  28.                 printf("\n");
  29.         }
  30.         return 0;
  31. }