判断回文数:
Java 实现:
public class Solution { public boolean isPalindrome(int x) { Integer tmp = 0; while(x > tmp) { tmp = tmp * 10 + x % 10; if(tmp == 0) { return false; } x = x / 10; } return (x == tmp || x == tmp / 10); } }