c4-8-2.c 309 B

123456789101112131415161718192021
  1. #include <stdio.h>
  2. int main()
  3. {
  4. int year,leap;
  5. scanf("%d",&year);
  6. if(year%4!=0)
  7. leap=0;
  8. else if (year%100!=0)
  9. leap=1;
  10. else if(year%400!=0)
  11. leap=0;
  12. else
  13. leap=1;
  14. if (leap)
  15. printf("%d is ",year);
  16. else
  17. printf("%d is not ",year);
  18. printf("a leap year.\n");
  19. return 0;
  20. }