Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
7416 | 黄言岐 | 闰年的数量 | C++ | Wrong Answer | 0 MS | 252 KB | 614 | 2025-04-25 21:03:24 |
#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int my_sum(int x,int y){ int ans=0; for(int i=x;i<=y;i++){ if(i%4==0&&i%100!=0){ ans+=1; } } return ans; } int main(){ int d,f; cin>>d>>f; if(d-f>f-d) cout<<my_sum(f,d)<<endl; if(d-f<f-d) cout<<my_sum(d,f)<<endl; return 0; }
------Input------
507 2591
------Answer-----
506
------Your output-----
501