Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
3059 | 邓程允 | 闰年的数量 | C++ | Accepted | 0 MS | 268 KB | 362 | 2024-03-30 17:56:40 |
# include<iostream> using namespace std; int a(int n){ if(n%100==0){ if(n%400==0)return 0; else return 1; } else { if(n%4==0)return 0; else return 1; } } int main(){ int x,y,l=0; cin>>x>>y; for(int i=x;i<=y;i++){ if(a(i)==0)l++; } cout<<l<<endl; return 0; }