​题目​

c++

class Solution {
public:
int a[100005];
bool isPalindrome(int x) {

if(x<0)
return false;


int pos=0;
while(x)
{
a[pos++]=x%10;
x/=10;
}

for(int i=0,j=pos-1;i<j;i++,j--)
{
if(a[i]!=a[j])
{
return false;
}
}

return true;

}
};