麻烦大佬们帮忙看一下哪儿有问题,谢谢谢谢谢

P5737 【深基7.例3】闰年展示

yuyuyuyu12345 @ 2022-08-23 16:36:43

#include <iostream>
using namespace std;
int a[100],k;
int main()
{
    int x,y;
    scanf("%d %d",&x,&y);
    for(int i=x;i<=y;i++)
    {
        if((i%4==0&&i%100!=0)||i%400==0){
            a[k++]=i;
        }
    }
    cout<<k<<endl;
    for(int i=0;i<k;i++) cout<<a[i]<<" ";
}

by BL_liuyuxuan @ 2022-10-06 12:04:58

起码260


上一页 |