/*
4.判断整数是否是回文(Determine whether an integer is a palindrome. Do this without extra space.)
,即从前面往后面读与从后面往前面读是一样的,例:12321;
*/
/*
class Solution {
public:
bool isPalindrome(int x) {
if(x<0){
return 0;
}else if(x==0){
return 1;
}
if(x == reverse(x)){
return 1;
}else{
return 0;
}
}
int reverse(int x){
int res=0;
while(x>0){
res = res*10 + x%10;
x /= 10;
}
return res;
}
};
*/
4.判断整数是否是回文(Determine whether an integer is a palindrome. Do this without extra space.)
,即从前面往后面读与从后面往前面读是一样的,例:12321;
*/
/*
class Solution {
public:
bool isPalindrome(int x) {
if(x<0){
return 0;
}else if(x==0){
return 1;
}
if(x == reverse(x)){
return 1;
}else{
return 0;
}
}
int reverse(int x){
int res=0;
while(x>0){
res = res*10 + x%10;
x /= 10;
}
return res;
}
};
*/