这是代码
#include <bits/stdc++.h>
using namespace std;
bool qwe(int n) {
if (n % 4 == 0 && n % 100 != 0) return true;
if (n % 400 == 0) return true;
return false;
}
int main() {
int l,r;
cin >> l >> r;
vector<int> vec;
int cnt = 0;
for (int i = l;i <= r;i++) {
if (qwe(i)) {
vec.push_back(i);
cnt++;
}
}
cout << cnt;
for (int num : vec) cout << num << " ";
return 0;
}
五个样例,AC了1个,剩下全WA了
有没有dalao或者神犇帮我改一下