随笔分类 -  算法 字符串

摘要:给定一个字符串(数字或大小写字母), 找出最长的对称的子串(如有多个,输出任意一个)。 例如: 输入:“abbaad” 输出:“abba” 阅读全文
posted @ 2019-03-02 17:05 douzujun 阅读(1052) 评论(0) 推荐(0) 编辑
摘要:#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 ... 阅读全文
posted @ 2018-07-16 10:09 douzujun 阅读(256) 评论(0) 推荐(0) 编辑
摘要:题解:模拟,把字符串按 6个一位放到字符串数组中,用string类的substr比较方便,substr(i*6, 6) 如果不足6位,就截取一直到最后的字符串...然后再分几组,加上每组的字符ASCII...写个 get_sum把三位数==>一位数... 阅读全文
posted @ 2018-03-31 17:01 douzujun 阅读(335) 评论(0) 推荐(0) 编辑
摘要:题解:写了简单题,好开心,我果然不适合学算法.......写写简单题,当个咸鱼就好了嘛!! #include <iostream> #include <algorithm> #include <cstdlib> #include <cstdio> #include <cstring> #includ 阅读全文
posted @ 2018-03-10 22:58 douzujun 阅读(304) 评论(1) 推荐(0) 编辑

点击右上角即可分享
微信分享提示