(C语言最详细解析)1003 我要通过! (20 分)
Judyyya:
感谢 终于明白题意了
图像识别研究现状
zxm19971104:
github上下载到博主的代码,想问博主考研去哪儿深造了哈哈哈
C语言版KMP算法
夢がある:
#include
typedef struct{
char *ch;
int length;
}String;
void StrAssign(String *T,char *chars){
char* c;
int i,j;
//printf("\n字符串为:\n%s\n",chars);
if(T->ch) free(T->ch);
for(i=0,c=chars;*c;++i,++c);
if(!i){T->ch=NULL;T->length=0;}
else{
if(!(T->ch=(char*)malloc(i*sizeof(char))))
printf("error\n");
for(j=0;jch[j]=chars[j];
T->length=i;
//printf("字符串长度为:%d\n",i);
}
}
void get_next(String T,int next[]){
int i,j;
i=1;
next[0]=-1;
j=0;
while(i |