#include<iostream>
using namespace std;
char a[100];
char b[100];
int la,lb,count;
void input_data()
{
cout<<"请输入子串:"<<endl;
cin>>a;
cout<<"请输入母串"<<endl;
cin>>b;
}
void solve()
{
bool match;
la=strlen(a);
lb=strlen(b);
count=0;
for(int i=0;i<=lb-la;i++)
{
match=true;
for(int j=0;j<la;j++)
{
if(a[j]!=b[i+j])
{
match=false;
break;
}
}
if(match)
count++;
}
}
void output_data()
{
if(count==0)
cout<<"a不是b的子串."<<endl;
else
cout<<"a在b中出现了"<<count<<"次"<<endl;
}
int main()
{
input_data();
solve();
output_data();
return 0;
}