题目链接:https://leetcode-cn.com/problems/palindrome-number/
题目如下:
class Solution {
public:
bool isPalindrome(int x) {
if(x<0) return false;
long long y=0;
int x_1=x;
while(x!=0){
int temp=x%10;
x=x/10;
y=y*10+temp;
}
return x_1==y;
}
};