leetcode Palindrome Number

回文数字,比较简单

class Solution {
public:
    bool isPalindrome(int x) 
    {
        if(x<0)return false;
        int y=x;
        int z=0;
        while(y>0)
        {
            int k=y%10;
            z=z*10+k;
            y=y/10;
        }
        if(z==x)return true;
        else return false;
    }
};
原文地址:https://www.cnblogs.com/tgkx1054/p/3105950.html