题目
Determine whether an integer is a palindrome. Do this without extra space.
解
class Solution {
public boolean isPalindrome(int x) {
if(x<0) return false;
int y=x;
int res=0;
while(y!=0){
res=res*10+y%10;
y=y/10;
}
if(res==x){
return true;
}
return false;
}
}