题解 | 判断闰年
判断闰年
https://www.nowcoder.com/practice/a7bcbe3cb86f435d9617dfdd20a16714
#include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
if (n % 400 == 0) {
cout << "yes" << endl;
} else if ((n % 4 == 0) && (n % 100 != 0)) {
cout << "yes" << endl;
} else {
cout << "no" << endl;
}
}
// 64 位输出请用 printf("%lld")
查看6道真题和解析