initial commit

This commit is contained in:
ShazidMahsrafi 2023-07-19 02:30:12 +06:00
parent 2c286f0168
commit 50df0356b2

46
208A Dubstep/208A.cpp Normal file
View File

@ -0,0 +1,46 @@
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
void solve()
{
string s, words;
cin >> s;
int i = 0;
while (i < s.size())
{
if (i + 2 < s.size() && s[i] == 'W' && s[i + 1] == 'U' && s[i + 2] == 'B')
{
i += 3;
}
else
{
if (!words.empty())
words += ' ';
while (i < s.size())
{
if (i + 2 < s.size() && s[i] == 'W' && s[i + 1] == 'U' && s[i + 2] == 'B')
break;
else
{
words += s[i];
i++;
}
}
}
}
cout << words << endl;
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int TC = 1;
//cin >> TC;
//cin.ignore();
while (TC--) solve();
}