#include <stdio.h> #include <math.h> #define N 100 #define year(y) !(y % 4)&&(y % 100)||!(y % 400) int main() { int y[N]; int t, i; for(i = 0; i < 2; i++) { scanf("%d", &y[i]); } for(i = 0; i < 2; i++) { if(year(y[i])) { printf("Leap Year\n"); } else { printf("Not Leap Year\n"); } } return 0; } |
Double click to view unformatted code.