import java.util.*;
public class Solution {
/**
* 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可
*
*
* @param x int整型
* @return bool布尔型
*/
public boolean isPalindrome (int x) {
// write code here
if (x < 0 || (x != 0 && x % 10 == 0)){
return false;
}
int a = 0;
int a1 = x;
while(a1 != 0){
a *= 10;
a += a1 % 10;
a1 /= 10;
}
return a == x ? true : false;
}
}



京公网安备 11010502036488号