先判断

  1. 是否是负数

  2. 是否是 大于10 个位是0的数

  3. 是否是 负数

  4. 倒序是否和正序 一样

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;
    }
};