标签:
1 public class Solution { 2 public boolean isPalindrome(int x) { 3 if(x<0) return false; 4 5 int temp = x, reverseX = 0; 6 while (temp > 0) { 7 reverseX = reverseX * 10 + temp % 10; 8 temp /= 10; 9 } 10 return x == reverseX; 11 } 12 }
标签:
原文地址:http://www.cnblogs.com/sweetculiji/p/4781303.html