题意:
求一个数是不是回文数
我的解法:
将此数倒过来,如果一样,那么就是回文数
public class Solution {
public boolean isPalindrome(int x) {
int cache = x;
int math = 0;
while(x > 0){
math *= 10;
math += x%10;
x /= 10;
}
return cache == math;
}
}