Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
82565 sh25_wuyy 展示闰年 C++ 通过 0 MS 252 KB 335 2026-01-15 18:51:29

Tests(1/1):


#include<bits/stdc++.h> using namespace std; int a[2500]; 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 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; }


测评信息: