Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
95179 黎瑾萱 闰年的数量 C++ Accepted 1 MS 272 KB 284 2024-10-27 09:38:47

Tests(10/10):


Code:

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