#include<stdio.h>
int main()
{
int year,leap;
printf("enter year:");
scanf("%d",year);
if (year%4==0)
{
if(year%100==0)
{
if(year%400==0)
leap=1;
else
leap=0;
}
else
leap=0;
if(leap)
printf("%d year is ",year);
else
printf(%d year is not ",year);
printf("a leap year.")
return 0;
}
写一程序,判断某一年是否为闰年
最新推荐文章于 2024-09-25 17:48:41 发布