非常简单的答案(开头的bool可以替换)
2025-11-29 12:20:51
发布于:浙江
2阅读
0回复
0点赞
#include<bits/stdc++.h>
using namespace std;
bool f(int n){
int x = 0,y = n;
while(y != 0){
x = x * 10 + y % 10;
y = y / 10;
}
if(n == x){
return true;
}else{
return false;
}
}
int main(){
int n;
cin >> n;
int sum = f(n);
if(sum == 0){
cout << "No";
}else{
cout << "Yes";
}
return 0;
}
全部评论 1
bool可以更换成int但可能要修改,具体我就不说了
1周前 来自 浙江
0

有帮助,赞一个