From c0892f3b5ca518d1730817351679d26a1022555d Mon Sep 17 00:00:00 2001 From: agindage <627620425@qq.com> Date: Thu, 18 Sep 2014 19:31:05 +0800 Subject: [PATCH] =?UTF-8?q?Create=20KMP=E7=AE=97=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "KMP\347\256\227\346\263\225" | 90 +++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 "KMP\347\256\227\346\263\225" diff --git "a/KMP\347\256\227\346\263\225" "b/KMP\347\256\227\346\263\225" new file mode 100644 index 0000000..899e85a --- /dev/null +++ "b/KMP\347\256\227\346\263\225" @@ -0,0 +1,90 @@ +#include +#include +#include +#define MAX 100 +void calNext(char *a,int *next) +{ + int i,j,lena; + lena=strlen(a); + next[0]=-1; + next[1]=0; + i=1; + j=0; + while(i=lena) + { + return j-lena; + } + return -2; +} + +int main() +{ + char a[MAX],b[MAX]; + int next[MAX]; + int i,lena,lenb,m,n,t=0,p=0; + while(scanf("%d",&n)!=EOF) + { + for(i=0;i