Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Codeforces Round 208A
- #include <string>
- #include <cstring>
- #include <iostream>
- using namespace std;
- int main()
- {
- int len;
- string s;
- char mass[201], nmass[201];
- cin >> s;
- len = s.length();
- strcpy(mass, s.c_str());
- int z = 0, check = 0;
- for(int i = 0; i < len; i++)
- {
- if(mass[i]=='W' && mass[i+1]=='U' && mass[i+2]=='B')
- {
- if(check==1){check=0;nmass[z]=' ';z++;}
- i+=2;
- }
- else
- {
- nmass[z] = mass[i];
- z++;
- check=1;
- }
- }
- for(int i = 0; i < z; i++)
- {
- cout << nmass[i];
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement