Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
79323 sh25_ganzy 展示闰年 C++ 通过 0 MS 248 KB 442 2026-01-02 15:46:31

Tests(1/1):


#include<bits/stdc++.h> using namespace std; bool a(int y){ if(y%4!=0){ return 0; }else if(y%100!=0){ return 1; }else if(y%400!=0){ return 0; }else{ return 1; } } int main(){ int x,y,cnt=0; cin>>x>>y; for(int i=x;i<=y;i++){ if(a(i)) cnt++; } cout<<cnt<<endl; for(int i=x;i<=y;i++){ if(a(i)) cout<<i<<" "; } return 0; }


测评信息: