|
+
|
... |
#include <iostream>
using namespace std;
int main() {
int a, b;
bool first = true;
while (cin >> a >> b) {
if (a == 0 && b == 0) break;
if (!first) cout << endl;
bool insist = false;
for (int i = a; i <= b; ++i) {
if (((i % 4 == 0) && (i % 100 != 0)) || (i % 400 == 0)) {
cout << i << endl;
insist = true;
}
}
if (!insist) {
cout << "NA" << endl;
}
first = false;
}
return 0;
}
|