闰年的判断
根据课本编写,自己添加了一丢丢
#include<stdio.h> int main() { int year,a; printf("请输入年份:\n"); scanf_s("%d", &year); a = ((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0); if (a == 1) printf("闰年\n"); else printf("不是闰年\n"); return 0; }
本文来自博客园,作者:木子欢儿,转载请注明原文链接:https://www.cnblogs.com/HGNET/p/11803818.html