标签:
Determine whether an integer is a palindrome. Do this without extra space.
class Solution { public: bool isPalindrome(int x) { int y = 0; int tmp = x; while(tmp){ y = y*10+tmp%10; tmp = tmp/10; } return x>=0 && y==x ; } };
标签:
原文地址:http://www.cnblogs.com/zengzy/p/5057552.html