time=434ms
负数不是回文数
public class Solution {
public boolean isPalindrome(int x) {
int palindrome=0;
int revers=x;
if(revers<0)
return false;
else{
while(revers>0){
int m=revers%10;
palindrome=m+palindrome*10;
revers=revers/10;
}
if(palindrome==x)
return true;
else
return false;
}
}
}