字符串匹配 - KMP算法

#include<cstdio>
#include<cstring>
#include<cstdlib>

void GetNext(char *t,int *next){
    ,j = ;
    next[] = ;
    ]){
         || t[i] == t[j]){
            i++;
            j++;
            if(t[i]!=t[j]){
                next[i] = j;
            }else{
                next[i] = next[j];
            }
        }else{
            j = next[j];
        }
    }
}
int index_kmp(char *s,char *t,int pos){
    int i = pos;
    ;
    ];

    GetNext(t,next);

    ] && j<=t[]){
         == j||s[i] == t[j]){
            i++;
            j++;
        }else{
            j = next[j];
        }
    }
    ]){
        ];
    }else{
        ;
    }
}
int main(){
    ] = " aaaas";
    ];
    t[] = strlen(t)-;
    )){
        s[] = strlen(s);
        printf());
    }
    ;
} 
上一篇:Centos6.8下SVN安装


下一篇:iOS 最新版 CocoaPods 的安装使用