C语言判断闰年程序
#include <stdio.h>
int main() { int year;
printf('请输入一个年份: ');
scanf('%d', &year);
if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {
printf('%d年是闰年\n', year);
} else {
printf('%d年不是闰年\n', year);
}
return 0;
}
原文地址: https://www.cveoy.top/t/topic/bxRA 著作权归作者所有。请勿转载和采集!