Codeforces-SolutionsA/Codes/208A Dubstep/208A.cpp
2023-12-15 13:43:18 +06:00

27 lines
454 B
C++

#include <iostream>
using namespace std;
int main()
{
string s;
int word = 0;
cin >> s;
for (int i = 0; i < s.size(); i++)
{
if (s[i] == 'W' && s[i + 1] == 'U' && s[i + 2] == 'B')
{
i += 2;
if (word)
{
word=0;
cout << " ";
}
}
else
{
word = 1;
cout << s[i];
}
}
return 0;
}