class Solution
{
public:
bool isPalindrome(int x)
{
if (x<0)
{
return false;
}
else if (0<=x&&x<=9)
{
return true;
}
else
{
double y=0;
int z=x;
while (x)
{
if (y*10>2147483647)
{
return false;
}
else
{
y=y*10;
y+=x%10;
x/=10;
}
}
if (z==y)
{
return true;
}
else
{
return false;
}
}
}
};