9 Palindrome_Number

Determine whether an integer is a palindrome. Do this without extra space.

判断一个数是否是回文数。

public class Solution {
 
  
    public boolean isPalindrome(int x) {  
        long xx = x;  
        long new_xx = 0;  
        while (xx > 0) {  
            new_xx = new_xx * 10 + xx % 10;  
            xx /= 10;  
        }  
        return new_xx == x;  
    }  

}
原文地址:https://www.cnblogs.com/zxqstrong/p/5274739.html