| Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|
| 55794 | 张思存 | 展示闰年 | C++ | Accepted | 1 MS | 252 KB | 405 | 2024-11-08 15:27:35 |
#include<bits/stdc++.h> using namespace std; bool run(int x){ bool flag=0; if(x%4==0&&x%100!=0||x%100==0&&x%400==0){ flag=1; } return flag; } int main(){ int a[2500]; int x,y,cnt=0; cin>>x>>y; for(int i=x;i<=y;i++){ if(run(i)){ a[++cnt]=i; } } cout << cnt << endl; for(int i = 1; i <= cnt; i++){ cout << a[i] << ' '; } return 0; }