#include #include using namespace std; int slen; int tlen; int next[1000000+5]; void get_next(string t) //求模式串T的next函数值 { int j=0,k=-1; next[0]=-1; while(j>s>>t; KMP(s,t); for(int i=1;i<=tlen;i++) cout<