9.回文数 class Solution { public boolean isPalindrome(int x) { if(x < 0){ return false; } int tmp = x, sum = 0; boolean flag = false; while(x != 0){ sum = sum * 10 + x % 10; x /= 10; } if(sum == tmp){ flag = true; } return flag; } }