用“多组数据”
#include<stdio.h>void main()
{
int year;
scanf("%d",&year);
while((scanf("%d",&year)!=EDF)
{
if((year%4==0&&year%100!=0)||year%400==0)
printf("%d is a leap year.\n",year);
else printf("%d is not a leap year.|n",year);
}
}
不知道哪里错误,这是判断闰年。
希望:
样例输入
1996
2001
样例输出
1996 is a leap year.
2001 is not a leap year.