#include <stdio.h>
#include <string.h>
int main(void) {
char *str = "0010010010";
char *what = "001";
int count = 0;
char *where = str;
if (what_len)
while ((where
= strstr(where
, what
))) { where += what_len;
count++;
}
printf("count = %d \n", count
); return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdHJpbmcuaD4KCmludCBtYWluKHZvaWQpIHsKCWNoYXIgKnN0ciA9ICIwMDEwMDEwMDEwIjsKICAgIGNoYXIgKndoYXQgPSAiMDAxIjsKCiAgICBpbnQgd2hhdF9sZW4gPSBzdHJsZW4od2hhdCk7CiAgICBpbnQgY291bnQgPSAwOwoKICAgIGNoYXIgKndoZXJlID0gc3RyOwoKICAgIGlmICh3aGF0X2xlbikgCiAgICAgICB3aGlsZSAoKHdoZXJlID0gc3Ryc3RyKHdoZXJlLCB3aGF0KSkpIHsKICAgICAgICAgICAgICAgIHdoZXJlICs9IHdoYXRfbGVuOwogICAgICAgICAgICAgICAgY291bnQrKzsKICAgICAgICAgICAgfQogICAgcHJpbnRmKCJjb3VudCA9ICVkIFxuIiwgY291bnQpOwoJcmV0dXJuIDA7Cn0K