设计一个程序,输入年份判断是否是闰年,c语言实现

如题所述

#include<stdio.h>
void Judge(int y)
{
while(1)
{
printf("请输入要计算的年份:\n");
scanf("%d",&y);
if((y%100==0)&&(y%400==0)||(y%100!=0)&&(y%4==0))
printf("%d年是闰年,该年2月份有29天\n",y);
else
printf("%d年是平年,该年2月份有28天\n",y);
printf("\n");
}
}
void main()
{
int year;
Judge(year);
}
温馨提示:答案为网友推荐,仅供参考

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网