#include "stdio.h"
#include "string.h"
#include <stdlib.h>
//统计字符串中出现指定串abcd的次数
int main(int argc, char *argv[])
{
char *p = "abcd1234abcd54a655abcd333af33";
int ncount = 0;
do
{
p = strstr(p, "a"); //查找字符串中第一次出现指定串abcd的首位子
if (p == NULL)
{
break;
}
else
{
ncount++;
p = p + strlen("abcd");
}
}while(*p != '\0');
printf("ncout:%d\n", ncount);
return 0;
}