![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
串
串的复习
I will,
淡然地接受努力过后依旧普通的自己
展开
-
串的模式匹配(暴力匹配算法)
#include<stdio.h> #define MAXLEN 255 typedef struct{ char ch[MAXLEN]; int length; }SString; int Index(SString S, SString T){ int i=0,j=0; while(i<S.length && j<T.length){ if(S.ch[i] == T.ch[j]){ ++i;++j; //继续比较后继字符 } els原创 2020-07-13 15:25:10 · 409 阅读 · 0 评论 -
串的基本操作(顺序存储)
#include<stdio.h> /*定义串*/ #define MAXLEN 255 typedef struct{ char ch[MAXLEN]; //每个分量存储一个字符 int length; //串的实际长度 }SString; /*求串的长度*/ int StrLength(SString S){ return S.length; } /*求子串*/ bool SubString(SString &Sub, SString S, int pos, int l原创 2020-07-13 15:20:43 · 2036 阅读 · 0 评论