摘要: 题目大意: 给你n个字符串,然后要求求一个最大的子串(或者子串的反串,子串可以倒过来的意思)在每个字符串中都出现。要求求这个子串的长度。解题思路:为了节省时间,先找出这些串中长度最短的,然后枚举这个串中的所有子串。再让这个子串或者反串去匹配每一个串,若都符合,即输出,然后退出。这里枚举,当然是从子串长度大的往小的枚举啦,节省时间。不过还是写了3重for循环,但是串的长... 阅读全文
posted @ 2011-12-01 13:58 cchun 阅读(285) 评论(0) 推荐(0) 编辑
摘要: find方法返回一个名为 string::npos 的特殊值,说明查找没有匹配。The string class provides six search functions, each named as a variant of find. The operations all return a string::size_type value that is the index of where ... 阅读全文
posted @ 2011-12-01 12:53 cchun 阅读(560) 评论(0) 推荐(0) 编辑