皮皮灰灰辉
皮皮灰灰辉
全部文章
分类
题解(20)
归档
标签
去牛客网
登录
/
注册
皮皮灰灰辉的博客
全部文章
(共5篇)
题解 | #参数解析#
字符串切分,可以通过strtok实现 易出错的点:见代码注释 #include <stdio.h> #include <stdlib.h> #include <string.h> char res[100][1000]; int main() { int...
C
字符串
2022-03-23
0
229
题解 | #合法IP#
简单的字符串切分,面向用例编程,判断的地方需要注意一点 #include<stdio.h> // 拆分字符串 int split(char in[50], char **sub) { char *p = in; char key[2] = "."; int num...
C
字符串
2022-03-21
0
223
题解 | #在字符串中找出连续最长的数字串#
没什么特殊的算法,不加注释了,一次遍历得结果,一次遍历输出就可以了 注意char转int型 #include <stdio.h> #include <stdlib.h> #include <string.h> int res[200][200] = {0}; ...
C
字符串
2022-03-21
0
301
题解 | #查找两个字符串a,b中的最长公共子串#
动态规划,类似的字符处理题有很多,可以结合起来一起做 注意的点是根据字符串长度分类讨论 #include <stdio.h> #include <stdlib.h> #include <string.h> char str1[301]; char str2[30...
C
动态规划
字符串
2022-03-18
0
253
题解 | #DNA序列#
滑动窗口,直接暴力遍历 #include <stdio.h> #include <stdlib.h> #include <string.h> int main() { char str[1005] = {0}; char res[1005] = ...
C
字符串
2022-03-18
0
234