题目描写叙述:
Determine whether an integer is a palindrome. Do this without extra space.
代码:
bool Solution::isPalindrome(int x)
{
int a = x;
int b = 0;
while(a > 0)
{
b = b * 10 + a % 10;
a = a % 10;
}
return b == x;
}