Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
97652 王思颜 闰年的数量 C++ Accepted 1 MS 272 KB 277 2024-11-16 11:52:55

Tests(10/10):


Code:

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