Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
62267 | 王一涵(吃土豆长大的马铃薯) | 展示闰年 | C++ | Accepted | 0 MS | 256 KB | 405 | 2025-03-13 17:19:39 |
#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; }