Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- void podnizNaKraj(char *niz, char *podniz){
- char *p;
- int br = 0;
- while ( (p = strstr(niz, podniz)) != NULL ) {
- strcpy(p, p + strlen(podniz));
- ++br;
- }
- while (br--){
- strcat(niz, podniz);
- }
- }
- int main(){
- char niz[100], podniz[100];
- gets(niz);
- gets(podniz);
- podnizNaKraj(niz, podniz);
- printf("\n%s", niz);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement