题目
Code:
#include <iostream>
#define int long long
using namespace std;
namespace solve {
bool check(int n) {
if (n % 4 == 0 && n % 100 != 0 || n % 400 == 0) return true;
else return false;
}
void f() {
int l, r;
cin >> l >> r;
int sum = 0;
for (int i = l; i <= r; ++i) {
if (check(i)) sum += i;
}
cout << sum;
}
}
using namespace solve;
signed main() {
f();
}
好了请@我