Here's my solution:

calculate the reverse number of x, then compare whether x and reverse is the same

Because a palindrome number will be same between original and reverse number.

```
bool isPalindrome(int x) {
if(x < 0) return false;//assume negative number isn't a palindrome
//calculate the reverse number of x, then compare whether x and reverse is the same
//because a palindrome number will be same between original and reverse number.
int reverse = 0, tmp = x;
while(tmp != 0){
reverse *= 10;
reverse += (tmp % 10);
tmp /= 10;
}
if(reverse == x)
return true;
return false;
}
```