Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
724 贺思哲 闰年的数量 C++ Accepted 0 MS 268 KB 311 2023-03-04 15:24:23

Tests(10/10):


Code:

#include<iostream> using namespace std; bool sb(int x){ if(x%400==0||x%4==0&&x%100!=0) return true; else return false; } int main(){ int y1,y2,sum=0; cin>>y1>>y2; for(int i=y1;i<=y2;i++){ if(sb(i)){ sum++; } } cout<<sum; }