方法一:使用C++中string的find()函数 1 #include <iostream> 2 3 using namespace std; 4 5 int main() 6 { 7 string t, p; 8 while(true) 9 { 10 int ans = 0; 11 cin >> t; 12 if(t == "#") 13 break; 14 cin >> p; 15 16 int pos = t.find(p); 17 while(pos != stri...
pid=2087 KMP匹配数—— AC代码: #include <iostream> #include <cstdio> #include <cstdlib> #include <cmath> #include <cstring> #include <string> #include <vector> #include <list> #include <deque> #include <queue> #include <iterator> #include <stack> #include #include <set> #include ...