#include <stdio.h>
#include <string.h> void main()
{
while()
{
char input1[] = {'\0'};
char input2[] = {'\0'};
int count = ; scanf("%s", &input1);
int len1 = (int)strlen(input1);
if(input1[] == '#')
return;
scanf("%s", &input2);
int len2 = (int)strlen(input2);
//对input1中的每len2个字符进行遍历
for(int i = ; i < len1;)
{
char tempBuf[] = {'\0'};
//在input1中取得len2个连续字符
for(int j = ; j < len2; j++)
{
if((i + j) < len1)
tempBuf[j] = input1[i + j];
else
break;
}
//比较
if(strcmp(tempBuf, input2) == )
{
count++;
i += len2;
}
else
i++;
}
printf("%d\n", count);
}
}
05-11 09:38