#include<stdio.h> #include<math.h> #include<string.h> main(){ int n,leap; while(scanf("%d",&n)!=EOF){ if(n%4==0&&n%100!=0) leap=1; else leap=0; if(n%400==0) leap=1; else leap=0; if(leap) printf("Leap Year"); else printf("Not Leap Year"); } } |
Double click to view unformatted code.