-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathA_Dubstep.cpp
More file actions
40 lines (33 loc) · 772 Bytes
/
A_Dubstep.cpp
File metadata and controls
40 lines (33 loc) · 772 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Dabananda Mitra, CSE (2019-20), ISTT.
// Email: imdmitra@outlook.com
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
#define TLE ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
void Solution(int t = 0) {
// start coding from here
string s, remix = "WUB", new_string = "";
cin >> s;
bool flag = false;
for (int i = 0; i < s.length(); i++) {
if (s[i] == 'W' && s[i + 1] == 'U' && s[i + 2] == 'B') {
i += 2;
flag = true;
} else {
if (flag && new_string.length() != 0) {
new_string += ' ';
new_string += s[i];
} else {
new_string += s[i];
}
flag = false;
}
}
cout << new_string << "\n";
}
int main() {
TLE;
Solution();
return 0;
}