80pts求条
查看原帖
80pts求条
1623120
_username_楼主2025/6/21 12:17

哪里错了?

#include <iostream>
using namespace std;

int main() {
	int a, b;
	cin >> a >> b;
	
	int ans = 0;
	for(int i = a ; i <= b ; i ++) {
		if(i % 400 == 0 || (i % 4 == 0 && i % 100 != 0)) {
			ans += i;
		} else {
			continue;
		}
	}
	
	cout << ans << endl;
	
	return 0;
}
2025/6/21 12:17
加载中...