Advertisement
Guest User

Untitled

a guest
Feb 20th, 2020
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2.  
  3. using namespace std;
  4. int p;
  5. string s;
  6.  
  7. int main()
  8. {
  9. ios_base::sync_with_stdio(0);
  10. cin.tie(0);
  11. while(getline(cin,s))
  12. {
  13. for(int i=0;i < s.size();i++)
  14. {
  15. if(p == 0)
  16. {
  17. if(s[i] == '/' && s[i+1] == '/')
  18. break;
  19. if(s[i] == '/' && s[i+1] == '*')
  20. {
  21. p = 1;
  22. i += 1;
  23. }
  24. else
  25. cout << s[i];
  26. }
  27. if(p == 1)
  28. {
  29. if(s[i] == '*' && s[i+1] == '/')
  30. {
  31. p = 0;
  32. i += 1;
  33. }
  34. }
  35. }
  36. cout << endl;
  37. }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement