#include<iostream>
#include<cstdlib>
#include<cmath>
#include<cstdio>
using namespace std;
int delete_sub_str(const char*str,const char*sub_str,char*result)
{
int count=0;
int len1=strlen(str);
int len2=strlen(sub_str);
int k=0;
for (int i=0;i<len1;)
{
int ct=0;
for (int j=0;j<len2;j++)
{
if (str[j+i]==sub_str[j])
{
ct++;
}
}
if (ct==len2)
{
count++;
i=i+len2;
}
else
{
result[k]=str[i];
k++;
i++;
}
}
result[k]='\0';
cout<<result<<endl;
return count;
}
int main()
{
int co;
char*str="123abc12abcstssh12abc";
char*sub_str="abc";
char*result=new char(strlen(str));
co=delete_sub_str(str,sub_str,result);
cout<<co;
return 0;
}