#include<iostream> #include<vector> #include<cstring> #include<cstdio> #include<algorithm> #include<cmath> #include<string> using namespace std; int rn(int n) { if (n % 4 == 0) { if (n % 100 != 0) return 1; else { if (n % 400 == 0) return 1; else return 0; } } else return 0; } int main() { long long int n; while (scanf("%d",&n)!=EOF) { if (rn(n) == 1) printf("Leap Year\n"); else printf("Not Leap Year\n"); } } |
Double click to view unformatted code.