Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int p;
- string s;
- int main()
- {
- ios_base::sync_with_stdio(0);
- cin.tie(0);
- while(getline(cin,s))
- {
- for(int i=0;i < s.size();i++)
- {
- if(p == 0)
- {
- if(s[i] == '/' && s[i+1] == '/')
- break;
- if(s[i] == '/' && s[i+1] == '*')
- {
- p = 1;
- i += 1;
- }
- else
- cout << s[i];
- }
- if(p == 1)
- {
- if(s[i] == '*' && s[i+1] == '/')
- {
- p = 0;
- i += 1;
- }
- }
- }
- cout << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement