判断条件:
1、能被400整除的,肯定是闰年;
2、能被4整除,但是不能被100整除的,是闰年;
3、其他的都是非闰年。
#include
void main ( )
{
int year,leap;
printf ("Please enter year:\n");
scanf ("%d",&year);
if (year%400==0)
leap=1;
else
if ((year%4==0)&&(year%100!=0))
leap=1;
else
leap=0;
if (leap!=0)
printf ("%d is a leap year.\n",year);
else
printf ("%d is not a leap year.\n",year);
}