Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
126352 周子潇 闰年的数量 C++ Accepted 117 MS 272 KB 601 2025-07-17 17:23:14

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; bool rn(int t) { if((t%4==0 && t%100!=0) || t%400==0) { return true; } else { return false; } } int main(){ int y,x; int sum=0; cin>>x; cin>>y; for(int i=x;i<=y;i++) { if(rn(i)==true) { sum++; } } cout<<sum; return 0; }