题目:7.阅读魔法书 - 蓝桥云课 (lanqiao.cn)
代码:
#include<iostream>
#include<stdio.h>
#include<algorithm>
using namespace std;
int main()
{string str;cin>>str;int n,ans=0;cin>>n;while(n--){string substr;cin>>substr;for(int i=0;i<=str.length()-substr.length();i++){if(substr==str.substr(i,substr.length())){ans++;}}}cout<<ans;return 0;
}