Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
62232 向芷涵 闰年的数量 C++ Accepted 1 MS 272 KB 259 2023-12-20 16:52:28

Tests(10/10):


Code:

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