摘要:
核心是模式串next数组的生成#include <stdio.h>#include <string.h>#define NS 100int strpos( char s1[] , char s2[] ,int N[]);void next( char s2[],int N[]);int main(int argc, char *args[] ){ int i = 0,k = 0; int N[NS] = {0}; next( args[2],N ); printf("%d\n",strpos(args[1],args[2],N)); return 0 阅读全文