BF算法

#include
#include
using namespace std;

int BF(char *s,int len_s,char *t,int len_t)
{
	int i,pos;
	i=pos=0;
	int j=0;
	while(i> s;
		cout << "输入匹配串:" ;
		cin >> t;
		int len_s=strlen(s);
		int len_t=strlen(t);

		int ans=BF(s,len_s,t,len_t);
		if(ans!=-1) 
			cout << "开始的位置为:" << ans << "\n" << endl;
		else
			cout << "未找到!!!" << "\n" << endl;
			
		cout << "按任意键继续!!!" << endl;
		getch();
	}
	return 0;
}

你可能感兴趣的:(BF算法)