我用c语言给你写了
main()
{int yy;
printf("Inter a year:\n");
scanf("%d",&yy);
if(yy%100==0&&yy%400==0||yy%100!=0&&yy%4==0)
printf("This is a leap year\n");
else
printf("This is not a leap year\n");
}
if( year%4 !=0 && (year%100==0 && year%400!=0)){
year = 平年
}else{
year = 闰年
}
if( year%4 ==0 && (year%100!=0 || year%400==0)){
year = 闰年
}else{
year = 平年
}
if ((year % 4 == 0) &&
(year % 100 != 0) ||
(year % 400 == 0))
{
}
if ( ((year %100 == 0) && (year % 400 == 0)) || (year %4 == 0) )
{
}