正解,留下我的足迹
2023-06-04 21:21:31
发布于:浙江
129阅读
0回复
0点赞
#include<iostream>
using namespace std;
int is_leap(int x){
if(x%4==0&&x%100!=0||x%400==0) return true;
else return 0;
}
int main() {
int n;
cin >> n;
if(is_leap(n)) cout << "Y" << endl;
else cout << "N" << endl;
return 0;
}
全部评论 2
不儿,我直接改题了
其实也可以#include<iostream> using namespace std; // 完成闰年判定 is_leap 函数 int main() { int n; cin >> n; if(n%100!=0&&n%4==0||n%400==0) cout << "Y" << endl; else cout << "N" << endl; return 0; }2025-10-10 来自 上海
0thank you for your tip,I forget %one hundred isn't equal to zero
2023-06-09 来自 安徽
0








有帮助,赞一个