1)写出在母串中查找子串出现次数的代码.
int count(char* str,char* s)
{
char* s1;
char* s2;
int count = 0;
while(*str!='/0')
{
s1 = str;
s2 = s;
while(*s2 == *s1&&(*s2!='/0')&&(*s1!='0'))
{
s2++;
s1++;
}
if(*s2 == '/0')
count++;
str++;
}
return count;
}