博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2012年10月5日

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2087View Code 1 #include<stdio.h> 2 #include<string.h> 3 4 void get_nextval(char T[ ],int nextval[ ]) 5 {//求模式串T的next函数修正值并存入数组nextval. 6 int i=1,j=0; 7 int length; 8 nextval[1]=0; 9 length=strlen(T);10 11 while(i<length)12 ... 阅读全文

posted @ 2012-10-05 14:21 皇星客栈--Linux 阅读(212) 评论(0) 推荐(0) 编辑

摘要: View Code 1 #include<stdio.h> 2 #include<string.h> 3 4 void get_nextval(char T[ ],int nextval[ ]) 5 {//求模式串T的next函数修正值并存入数组nextval. 6 int i=1,j=0; 7 nextval[1]=0; 8 int length; 9 length=strlen(T);10 11 while(i<length)12 { 13 if(j==0||T[i]==T[j])14 ... 阅读全文

posted @ 2012-10-05 13:27 皇星客栈--Linux 阅读(368) 评论(0) 推荐(0) 编辑