BUPT-homework/pset2/3-year.c
2021-09-28 22:44:09 +08:00

28 lines
404 B
C

#include <stdio.h>
int main(void) {
// initialize values
int year;
scanf("%i", &year);
// calculate values
if (year % 4 == 0) {
if (year % 100 == 0) {
if (year % 400 == 0) {
printf("Yes");
return 0;
} else {
printf("No");
return 0;
}
} else {
printf("Yes");
return 0;
}
} else {
printf("No");
}
return 0;
}