题解
2025-02-03 19:50:43
发布于:江苏
11阅读
0回复
0点赞
#include<iostream>
using namespace std;
bool huiwen(int n){
int x=0,y=n;
while(y!=0){
x*=10;
x+=y%10;
y/=10;
}
if(x==n){
return true;
}else{
return false;
}
}
bool runnian(int n){
if(n%4==0){
if(n%100==0){
return 0;
}else if(n%400==0){
return 1;
}else{
return 1;
}
}else{
return 0;
}
}
int main(){
int n;
cin>>n;
if(huiwen(n)==1&&runnian(n)==1){
cout<<"Yes";
}else{
cout<<"No";
}
return 0;
}
这里空空如也
有帮助,赞一个