题目描述:
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; }
原文地址:http://blog.csdn.net/yao_wust/article/details/40829847