Leetcode: Palindrome Number

来源:互联网 发布:怎么找网络棋牌漏洞 编辑:程序博客网 时间:2024/06/05 15:38
class Solution {public:    bool isPalindrome(int x) {        int str[30];        int  cur=0;        if(x<0){            return false;        }                while(x!=0){            str[cur++]=x%10;            x/=10;        }                for(int i=0;i<cur/2;i++){            if(str[i]!=str[cur-i-1]){                return false;            }        }        return true;            }};

0 0