判断回文 c++

class Solution {
public:
    bool isPalindrome(string s) {
        // Start typing your C/C++ solution below
        // DO NOT write int main() function
            	string ss;
		ss.assign(s.rbegin(),s.rend());
		if(s==ss)
			return true;
		else
			return false;
        
    }
};

  

posted @ 2013-05-11 18:58  立春了  Views(189)  Comments(0Edit  收藏  举报