// JudgeLeapYear.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
//判断输入年份是否为闰年
#include <stdio.h>
void main() {
int year, leap; //leap = 1为闰年,等于0不是闰年
scanf_s("%d", &year);
if (year % 4 == 0) {
if (year % 100 == 0) {
if (year % 400 == 0) {
leap = 1;
}
else {
leap = 0;
}
}
else {
leap = 1;
}
}
else {
leap = 0;
}
if (leap == 1) {
printf("This year is a leap year");
}
else {
printf("This year isn't a leap year");
}
}