Advertisement
Salman_CUET_18

dubstep

Mar 26th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<string.h>
  3. int main(void)
  4. {
  5. char dubstep[1000], words[1000];
  6. int len, i, j = 0;
  7. scanf("%s", dubstep);
  8. len = strlen(dubstep);
  9. for(i = 0; i < len;)
  10. {
  11. if(dubstep[i] == 'W' && dubstep[i+1] =='U' && dubstep[i+2] =='B') i += 3;
  12. else
  13. {
  14. words[j] = dubstep[i];
  15. j++;
  16. i++;
  17. if(dubstep[i] == 'W' && dubstep[i+1] =='U' && dubstep[i+2] =='B')
  18. {
  19. words[j] = ' ';
  20. j++;
  21. }
  22. }
  23. }
  24.  
  25. words[j] = '\0';
  26. printf("%s", words);
  27. return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement