Advertisement
Guest User

Untitled

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