class Solution {
public:
bool isPalindrome(int x) {
if (x < 0) {
return false;
}
string str = to_string(x);
for (int i = 0; i < str.size(); i++) {
if (str[i] != str[str.size() - 1 - i]){
return false;
}
}
return true;
}
};
class Solution {
public:
bool isPalindrome(int x) {
string s=to_string(x);
string ori=s;
reverse(s.begin(),s.end());
return s==ori;
}
};