Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- int main()
- {
- char c[100], v[10240];
- scanf("%s %[^\n]", c,v);
- char *i=v;
- int counter=0;
- while(1)
- {
- char *poz;
- poz=strstr(i,c);
- if(poz==NULL)
- {
- break;
- }
- counter++;
- i=poz+1;
- }
- printf("%d",counter);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment