#include <iostream>
#include <math.h>
#include <map>
#include <vector>
#include <string.h>
#include <memory>
#include <string>
#include <stdio.h>
#include <algorithm>
using namespace std;
int main()
{
string s , p;
int location = 0;
int count = 0;
cin >> s >> p;
location = s.find(p,location);
while(location != string::npos)
{
count++;
location = s.find(p,location + p.size() - 1);
}
cout << count << endl;
return 0;
}
华为机试:查找字符串
最新推荐文章于 2024-09-17 02:57:01 发布