Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- int i,flag=0;
- char str[10010];
- scanf("%s",&str);
- for(i=0; str[i]; i++)
- {
- if(str[i]=='W')
- {
- if(str[i+1]=='U')
- {
- if(str[i+2]=='B')
- {
- i=i+2;
- if(flag==1)
- if(flag==1)
- {
- if( str[i-1]!='B' || str[i]!='U' || str[i-3]!='W')
- {
- printf(" ");
- }
- }
- }
- else
- {
- printf("WU");
- i++;
- }
- }
- else
- {
- printf("W");
- }
- }
- else
- {
- printf("%c",str[i]);
- flag=1;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement