liyuzhuo2013 @ 2024-09-07 16:09:37
#include <bits/stdc++.h>
using namespace std;
int main() {
int x,y,m=0,a[10000];
cin>>x>>y;
for(int i=x;i<y;i++){
if(i%4==0&&1%100!=0||i%400==0){
m++;
}
}
cout<<m<<endl;
for(int i=x;i<y;i++){
if(i%4==0&&1%100!=0||i%400==0){
cout<<i<<" ";
}
}
return 0;
}
by haley001 @ 2024-09-07 16:12:04
if(i%4==0&&1%100!=0||i%400==0){
1%100==0
6
by haley001 @ 2024-09-07 16:13:45
还有
i%4==0&&i%100!=0
要加括号
by haley001 @ 2024-09-07 16:14:52
for(int i=x;i<y;i++){
是i<=y