https://leetcode.com/problems/palindrome-number/

class Solution {
public:
    
    bool isPalindrome(int x) {
        using namespace std;
        if(x<0) return false;
        string s=to_string(x);
        int l=0,r=s.size()-1;
        while(l<r){
            if(s[l]!=s[r]) return false;
            ++l,--r;
        }
        return true;
    }
};
扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。