```
public class Solution {
public boolean isPalindrome(int x) {
if(x < 0) return false;
if(x < 10) return true;
for(int i = 1;;i++){
if((int)(x / Math.pow(10,i)) == 0){
for(int m = i-1; m >= 1;m = m-2){
if((int)(x / Math.pow(10,m)) == (int)(x % Math.pow(10,1))){
x = (int)(x % Math.pow(10,m));
x = (int)(x / Math.pow(10,1));
}else{
return false;
}
}
break;
}
}
return true;
}
}
```