Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
95181 | 倪士燊 | 闰年的数量 | C++ | Wrong Answer | 0 MS | 264 KB | 449 | 2024-10-27 09:40:18 |
#include<bits/stdc++.h> using namespace std; bool isRN(int year) { if(year%4==0 && year%100!=0 || year%400==0) { return 1; } return 0; } int main(){ int x,y,count=0; for(int i=x;i<=y;i++) { if(isRN(i)==1) { count++; } } cout<<count; return 0; } //int a; //cin>>a; //a = a%4; //if(a==0) // { // cout<<"yes"; // return 0; // } // cout<<"no"; // return 0;
------Input------
685 1586
------Answer-----
218
------Your output-----
1