public boolean isPalindrome(int x) {
int p = 0;
int input = x;
while (x > 0) {
p = p * 10 + x % 10;
x /= 10;
}
return input == p;
}
public boolean isPalindrome(int x) {
int p = 0;
int input = x;
while (x > 0) {
p = p * 10 + x % 10;
x /= 10;
}
return input == p;
}
本文标题:Other:判断数字是不是回文
本文链接:https://www.haomeiwen.com/subject/kmdnrttx.html
网友评论