Advertisement
Guest User

Untitled

a guest
Dec 11th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. int main()
  5. {
  6. char c[100], v[10240];
  7. scanf("%s %[^\n]", c,v);
  8. char *i=v;
  9. int counter=0;
  10. while(1)
  11. {
  12. char *poz;
  13. poz=strstr(i,c);
  14. if(poz==NULL)
  15. {
  16. break;
  17. }
  18. counter++;
  19. i=poz+1;
  20. }
  21. printf("%d",counter);
  22. return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement