c语言 判断年份是否闰年

/#define _CRT_SECURE_NO_WARNINGS
//#include<stdio.h>
//#include<stdlib.h>
//int main() {
// int x;
// scanf("%d", &x);
//普通闰年:能被4整除但不能被100整除的年份为普通闰年;世纪闰年:能被400整除的为世纪闰年。
// if (x % 400 == 0 || x % 4 == 0 && x % 100 != 0)
// {
// printf("%d年是闰年\n", x);
// }
// else{
// printf("%d年不是闰年\n", x);
// }
// system(“pause”);
// return 0;
//}

猜你喜欢

转载自blog.csdn.net/tianyuzilin/article/details/88853971