leetcode 9

判断回文数

 1 class Solution {
 2 public:
 3     bool isPalindrome(int x) {
 4         std::stringstream ss;
 5         ss<<x;
 6         string str;
 7         ss>>str;
 8         for(int i=0,j=str.size()-1;i<j;i++,j--)
 9         if(str[i]!=str[j])
10         return 0;
11         return 1;
12     }
13 };
原文地址:https://www.cnblogs.com/thefirstfeeling/p/5915613.html