题解
2024-08-16 18:26:58
发布于:浙江
4阅读
0回复
0点赞
#include <iostream>
#include <cstdio>
using namespace std;
int n;
bool huiwen(){
int t = n;
int x = 0;
while(t){
x = x * 10 + t % 10;
t /= 10;
}return x == n;
}
bool runnian(){
if(n % 400 == 0) return 1;
if(n % 100 == 0) return 0;
if(n % 4 == 0) return 1;
return 0;
}
int main(){
cin >> n;
if(huiwen() && runnian()) cout << "Yes";
else cout << "No";
return 0;
}
这里空空如也
有帮助,赞一个