#include <stdio.h> #include <stdlib.h> #include <string.h> #define ASCII_SIZE 256 /*一个字符一个字符移动比较*/ //暴力匹配BF算法 int BF_BruteForce(char *dest, char *src) { int i, j; if (NULL == dest || NULL == src) { return -1; } int n = (int)strlen(dest); int m = (int)strlen(src); if (n > m) { return -2; } for (i = 0; i <= m - n; i++) { if (dest[0] == src[i]) { for (j = 0; j <= n; j++) { if (dest[j] != src[j + i]) { break; } else if (dest[j + 1] == '