![](https://video.ask-data.xyz/img.php?b=https://iknow-pic.cdn.bcebos.com/4ec2d5628535e5dd0c12009b7bc6a7efce1b62bc?x-bce-process=image%2Fresize%2Cm_lfit%2Cw_600%2Ch_800%2Climit_1%2Fquality%2Cq_85%2Fformat%2Cf_auto)
#include<stdio.h>
#include<string.h>
int fun(char *a,char *b)
{ int i,j,n1,n2,n3,n4=0;
n1=strlen(a);
n2=strlen(b);
for(i=0;i<n1;i++){
n3=0;
for(j=0;j<n2;j++)
if(*(a+i+j)==*(b+j)) n3++;
if(n3==n2){
n4++;
i+=j-1;
}
}
return n4;
}
main()
{ char a[1000],b[100];
while(1){
gets(a);
gets(b);
printf("%d\n\n",fun(a,b));
}
}
如图所示,望采纳。。。。。。
追问是自己写的吗?