随笔分类 - 算法 字符串
摘要:给定一个字符串(数字或大小写字母), 找出最长的对称的子串(如有多个,输出任意一个)。 例如: 输入:“abbaad” 输出:“abba”
阅读全文
摘要:#include #include #include using namespace std; int BF(char s[], char t[]) //BF算法 { int i = 0, j = 0; int m = strlen(s); int n = strlen(t); while (i = n) return ...
阅读全文
摘要:题解:模拟,把字符串按 6个一位放到字符串数组中,用string类的substr比较方便,substr(i*6, 6) 如果不足6位,就截取一直到最后的字符串...然后再分几组,加上每组的字符ASCII...写个 get_sum把三位数==>一位数...
阅读全文
摘要:题解:写了简单题,好开心,我果然不适合学算法.......写写简单题,当个咸鱼就好了嘛!! #include <iostream> #include <algorithm> #include <cstdlib> #include <cstdio> #include <cstring> #includ
阅读全文