题解
2026-03-31 13:28:49
发布于:浙江
2阅读
0回复
0点赞
#include<iostream>
using namespace std;
// 完成回文数判定 is_pal 函数
bool is_pal(int n){
int sum=0,m=n;
while(m>0){
sum=sum*10+m%10;
m/=10;
}
if(n==sum)return 1;
return 0;
}
int main() {
int n;
cin >> n;
if(is_pal(n)) cout << "Yes" << endl;
else cout << "No" << endl;
return 0;
}
这里空空如也

有帮助,赞一个