/*判断year年份是否为闰年(能被4整除是闰年,能被整除100不是,能被400整除是闰年)*/
#include<stdio.h>
#include<stdlib.h>
void main()
{
int year,leap_year;
scanf("%d",&year);
if(year%400==0)
{
leap_year=1;
printf("%d is 闰年",year);
}
else if(year%100==0)
{
leap_year=0;
printf("%d is not 闰年",year);
}
</
#include<stdio.h>
#include<stdlib.h>
void main()
{
int year,leap_year;
scanf("%d",&year);
if(year%400==0)
{
leap_year=1;
printf("%d is 闰年",year);
}
else if(year%100==0)
{
leap_year=0;
printf("%d is not 闰年",year);
}
</