class Solution {
public:
bool isPalindrome(int x) {
if(x<0){
return false;
}
long x1 = x;
long x2 = 0;
do{
x2*=10;
x2+=x1%10;
x1/=10;
}while(x1!=0);
return x==x2;
}
};
AC100%