Posted on 2007-06-28 21:58
停留的风 阅读(207)
评论(0) 编辑 收藏 所属分类:
C语言学习历程
#include <stdio.h>
int main(void)
{
int year;
printf(" Enter a year like this \"1986\" : ");
scanf("%i",&year);
if(year%4==0&&year%100!=0||year%400==0)
{
printf("This year %i is a leap year!\n",year);
}
else
{
printf("This year %i is not a leap year!\n",year);
}
return 0;
}