Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
131397 李昊宇 闰年的数量 C++ Accepted 1 MS 272 KB 303 2025-09-23 20:10:30

Tests(10/10):


Code:

#include<bits/stdc++.h> using namespace std; bool sum(int year) { return year % 4 == 0 && year % 100 != 0 || year % 400 == 0; } int main() { int a,end; cin>>a>>end; int ans = 0; for (int i = a; i <= end; i++) { if(sum(i)) ans ++ ; } cout<<ans; }