2013年6月25日

判断回文

摘要: 早上闲得无聊,写个判断回文的小程序,对于一个字符串,是否是回文,相信大家都知道。不过这个小demo可以清除混淆视听的字符,比如非字母,数字,清除空格然后再判断 废话少说上代码 1 #ifndef __PALINDROME_H 2 #define __PALINDROME_H 3 #include 4 #include 5 using std::string; 6 using std::stringstream; 7 // string trim的简单高效实现 8 string& LTrim(string& str) 9 { 10 if (str.find_first_... 阅读全文

posted @ 2013-06-25 10:07 SandyNie 阅读(223) 评论(0) 推荐(0) 编辑

导航