解题:生日
2023-07-18 13:02:20
发布于:广东
26阅读
0回复
0点赞
空降坐标:CP003107
请看代码
#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n,sum=0,t;
    cin>>n;
    t=n;
    while(sum!=5)
    {
        if(t%100!=0&&t%4==0||t%400==0)   //四年一闰,百年不闰,四百年再一闰
        {
            cout<<t<<endl;
            sum++;
        }
        t++;
    }
    return 0;
}
这里空空如也


有帮助,赞一个