Code implementation:
borrowing a wonderful method, the two numbers are equal after inversion
bool isPalindrome(int x){
if(x<0)
return false;//直接杀死负数
long y=0;
int temp=x;
while(temp!=0){
y=y*10+temp%10;
temp/=10;
}
if(y==x)
{
return true;
}
return false;
}