输入一个整形数表示年份,如果是闰年输出“闰年”,否则输出“平年”,要考虑年份被100整除但是不能被400整除的情形
#include<stdio.h>
int main()
{
int year,result;
scanf("%d",&year);
if( year%4 == 0 && year % 100 != 0 || year % 400 == 0 )
result=1;
else
result=0;
printf("%d",result);
return 0;
}
#include
int main()
{
int year,result;
scanf("%d",&year);
if( year%4 == 0 && year % 100 != 0 || year % 400 == 0 )
result=1;
else
result=0;
printf("%d",result);
return 0;
}