#include<stdio.h>
int leap(int year)
{
if((year%4==0)&&(year%100!=0)||(year%400==0))
{
return 1;
}
else
{
return 0;
}
}
int main()
{
int year;
int ret;
scanf("%d",&year);
ret=leap(year);
if(ret==1)
{
printf("%d is a leap year;",year);
}
else
{
printf("%d is not a leap year;",year);
}
return 0;
}
转载于:https://blog.51cto.com/10740329/1703935