#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void){
char *p = "abcedabc";
int n = 0;
do{
p = strstr(p, "ab");
if (p != NULL){
n++;
p = p + strlen("ab");
}
else{
break;
}
} while (*p != 0);
printf("n=%d", n);
printf("\n");
system("pause");
return 0;
}