题目链接:点击打开链接
类型:数学处理
解法:Reverse Integer
public class Solution {
public boolean isPalindrome(int x) {
if (x < 0)
return false;
int reverse = 0;
int compare = x;
while (x > 0)
{
reverse = reverse*10 + x%10;
x /= 10;
}
return reverse == compare;
}
}