先判断
是否是负数
是否是 大于10 个位是0的数
是否是 负数
倒序是否和正序 一样
class Solution {
public:
bool isPalindrome(int x) {
long long temp = 0;
int x1 = x;
if(x<0) return false;
if(x % 10 == 0 && x > 10) return false;
while (x)
{
temp = temp *10 + x % 10;
x = x / 10;
}
return temp == x1;
}
};