bool isPalindrome(int x) {
int val = 0;
int n;
int y = x;
if(x<0) return false;
while(x){
n = x%10;
val = val * 10 + n;
x /= 10;
}
return (y == val);
}
LeetCode9回文数
猜你喜欢
转载自blog.csdn.net/a_learning_boy/article/details/84334784
今日推荐
周排行