题解
2025-05-31 20:17:43
发布于:浙江
0阅读
0回复
0点赞
#include<iostream>
using namespace std;
// 完成回文数判定 is_pal 函数
bool is_pal(int n){
int h=0;
int j=n;
while(n!=0){
h=h*10+n%10;
n/=10;
}
if(h==j) return true;
else return false;
}
int main() {
int n;
cin >> n;
if(is_pal(n)) cout << "Yes" << endl;
else cout << "No" << endl;
return 0;
}
这里空空如也
有帮助,赞一个