标签:
public class Solution { public boolean isPalindrome(int x) { if (x < 0) { return false; } return x == reverse(x); } public int reverse(int x) { int res = 0; while (x != 0) { res = res*10 + x%10; x = x/10; } return res; } }
标签:
原文地址:http://www.cnblogs.com/77rousongpai/p/4499957.html