Advertisement
Falak_Ahmed_Shakib

208A - Dubstep wow

Jul 28th, 2019
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. int i,flag=0;
  6. char str[10010];
  7. scanf("%s",&str);
  8. for(i=0; str[i]; i++)
  9. {
  10. if(str[i]=='W')
  11. {
  12. if(str[i+1]=='U')
  13. {
  14. if(str[i+2]=='B')
  15. {
  16. i=i+2;
  17. if(flag==1)
  18. if(flag==1)
  19. {
  20. if( str[i-1]!='B' || str[i]!='U' || str[i-3]!='W')
  21. {
  22. printf(" ");
  23.  
  24. }
  25. }
  26.  
  27. }
  28. else
  29. {
  30. printf("WU");
  31. i++;
  32. }
  33. }
  34. else
  35. {
  36. printf("W");
  37.  
  38. }
  39.  
  40.  
  41.  
  42. }
  43. else
  44. {
  45. printf("%c",str[i]);
  46.  
  47. flag=1;
  48. }
  49. }
  50.  
  51. return 0;
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement