用函数解决滴,不是函数看其他人滴
2023-10-16 20:46:50
发布于:广东
16阅读
0回复
0点赞
#include<bits/stdc++.h>
using namespace std;
// 完成闰年判定 is_leap 函数
bool isleap (int n){
if(n%40 && n%100!=0 or n%4000)
{
return true;
}
return false;
}
int main() {
int n,cnt=1;
cin >> n;
for(int i=n;cnt<=5;i++)
{
		if(isleap(i)) 
		{
			cout<<i<<endl;
			cnt++;
		}
}
return 0;
}
这里空空如也

有帮助,赞一个