Desicription Determine whether an integer is a palindrome. Do this without extra space. Solution 1234567891011121314 class {public: bool isPalindrome(int x) { stringstream stream; string res; stream << x; stream >> res; for(int i = 0, j = res.size()-1; i <= j; i++, j--){ if(res[i] != res[j]) return 0; } return 1; }}; 赞微海报分享
近期评论