A368.完成闰年判定函数
2025-08-15 20:21:33
发布于:江苏
0阅读
0回复
0点赞
官方很贴心,主函数都帮忙写好了。
#include<iostream>
using namespace std;
// 完成闰年判定 is_leap 函数
bool is_leap(int y) {
return y%4==0 && y%100 || y%400==0;
}
int main() {
int n;
cin >> n;
if(is_leap(n)) cout << "Y" << endl;
else cout << "N" << endl;
return 0;
}
这里空空如也
有帮助,赞一个