@[Lindafish](/user/1210664) 第十行:```if((i%4==0&&x%100!=0)```
应该是i%100!=0吧
by penguin_is_cool @ 2024-01-30 22:43:50
@[Lindafish](/user/1210664) 第二个判断也是
by penguin_is_cool @ 2024-01-30 22:44:18
@[Lindafish](/user/1210664) 你还忘了输出换行和空格
修改后AC代码:
```c
#include <stdio.h>
int main()
{
int x,y;
scanf("%d %d",&x,&y);
int i=x,year=x;
int count=0;
for (i=x;i<=y;i++){
if ((i%4==0&&i%100!=0)||(i%100==0&&i%400==0)){
count++;
}
}
printf("%d\n",count);
for (year=x;year<=y;year++){
if ((year%4==0&&year%100!=0)||(year%100==0&&year%400==0)){
printf("%d ",year);
}
}
return 0;
}
```
by penguin_is_cool @ 2024-01-30 22:46:39
@[penguin_is_cool](/user/1065176) 哇哇哇,太感谢大佬连续回我两个求助贴了(✧◡✧)
by Lindafish @ 2024-01-30 22:58:52