(1)
int func(char *str, char *substr)
{
int count = 0;
char *cur = substr;
while (*str != '\0')
{
if (*str == *cur)
{
while (*cur != '\0')
{
if (*cur++ == *str++)
continue;
else
break;
}
if (*cur == '\0')
count++;
cur = substr;
}
else
{
str++;
}
}
return count;
}
(1)
int
func(char
*str,
char
*substr)
{
int
count
=
0;
char
*cur
=
substr;
while
(*str
!=
'\0')
{
if
(*str
==
*cur)
{
while
(*cur
!=
'\0')
{
if
(*cur++
==
*str++)
continue;
else
break;
}
if
(*cur
==
'\0')
count++;
cur
=
substr;
}
else
{
str++;
}
}
return
count;
}