Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
154136 黄俊然 闰年的数量 C++ Accepted 1 MS 272 KB 529 2026-05-24 15:30:30

Tests(10/10):


Code:

#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 n(int x){ if(x%4==0 && x%100!=0|| x%400==0){ return 1; } else{ return 0; } } int main(){ int a,b,sum=0; cin>>a>>b; for(int i=a;i<=b;i++){ if(n(i)==1){ sum++; } } cout<<sum; return 0; }