Advertisement
rengetsu

CF_208A

Nov 7th, 2018
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.67 KB | None | 0 0
  1. // Codeforces Round 208A
  2. #include <string>
  3. #include <cstring>
  4. #include <iostream>
  5. using namespace std;
  6. int main()
  7. {
  8.     int len;
  9.     string s;
  10.     char mass[201], nmass[201];
  11.     cin >> s;
  12.     len = s.length();
  13.     strcpy(mass, s.c_str());
  14.     int z = 0, check = 0;
  15.     for(int i = 0; i < len; i++)
  16.     {
  17.         if(mass[i]=='W' && mass[i+1]=='U' && mass[i+2]=='B')
  18.         {
  19.             if(check==1){check=0;nmass[z]=' ';z++;}
  20.             i+=2;
  21.         }
  22.         else
  23.         {
  24.             nmass[z] = mass[i];
  25.             z++;
  26.             check=1;
  27.         }
  28.     }
  29.     for(int i = 0; i < z; i++)
  30.     {
  31.         cout << nmass[i];
  32.     }
  33.     return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement