Advertisement
Guest User

Untitled

a guest
Jan 27th, 2015
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. #include <stdio.h>
  2. void podnizNaKraj(char *niz, char *podniz){
  3. char *p;
  4. int br = 0;
  5. while ( (p = strstr(niz, podniz)) != NULL ) {
  6. strcpy(p, p + strlen(podniz));
  7. ++br;
  8. }
  9. while (br--){
  10. strcat(niz, podniz);
  11. }
  12. }
  13. int main(){
  14. char niz[100], podniz[100];
  15. gets(niz);
  16. gets(podniz);
  17. podnizNaKraj(niz, podniz);
  18. printf("\n%s", niz);
  19. return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement