Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- typedef long long ll;
- typedef long double ld;
- void solve()
- {
- string inp;
- bool ka = false;
- ll com1 = 0;
- ll com2 = 0;
- ll com3 = 0;
- while (getline(cin, inp)){
- for (int i = 0; i < inp.size(); i++){
- if (com1 > 0 || com2 > 0 || com3 > 0){
- if (inp[i] == '\'' || inp[i] == '`' || inp[i] == '"'){
- com1--;
- }
- cout << inp[i];
- continue;
- }
- if (ka){
- if (inp[i] == '*'){
- if (i < inp.size() - 1 && inp[i + 1] == '/'){
- i++;
- ka = false;
- continue;
- }
- }
- continue;
- }
- if (inp[i] == '\'' || inp[i] == '`' || inp[i] == '"'){
- com1++;
- }
- if (inp[i] == '/'){
- if (i < inp.size() - 1){
- if (inp[i + 1] == '/'){
- break;
- }
- if (inp[i + 1] == '*'){
- ka = true;
- cout << ' ';
- continue;
- }
- }
- }
- cout << inp[i];
- }
- if (!ka)
- cout << '\n';
- }
- }
- int main()
- {
- ios_base::sync_with_stdio(false);
- cin.tie(0);
- cout.tie(0);
- solve();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement