很2的一个解法, 好多情况没考虑, 只考虑正数了
class Solution { public: bool isPalindrome(int x) { if(x<0)return false; int numbers = x; int digit = 0; int times = 10; while(numbers) { digit = 10 * digit + numbers%10; numbers /= 10; } if(digit==x) return true; return false; } };