Codeforces-SolutionsA/Codes/208 A - Dubstep/208A.cpp

27 lines
454 B
C++
Raw Normal View History

2023-07-19 04:38:40 +08:00
#include <iostream>
2023-07-19 04:30:12 +08:00
using namespace std;
2023-07-19 04:38:40 +08:00
int main()
2023-07-19 04:30:12 +08:00
{
2023-07-19 04:38:40 +08:00
string s;
int word = 0;
2023-07-19 04:30:12 +08:00
cin >> s;
2023-07-19 04:38:40 +08:00
for (int i = 0; i < s.size(); i++)
2023-07-19 04:30:12 +08:00
{
2023-07-19 04:38:40 +08:00
if (s[i] == 'W' && s[i + 1] == 'U' && s[i + 2] == 'B')
2023-07-19 04:30:12 +08:00
{
2023-07-19 04:38:40 +08:00
i += 2;
if (word)
{
word=0;
cout << " ";
}
2023-07-19 04:30:12 +08:00
}
else
{
2023-07-19 04:38:40 +08:00
word = 1;
cout << s[i];
2023-07-19 04:30:12 +08:00
}
}
2023-07-19 04:38:40 +08:00
return 0;
2023-07-19 04:30:12 +08:00
}