fork download
  1. string s;
  2. list<char> res;
  3. int main() {
  4. boost;
  5. tcase {
  6. cin >> s;
  7. int n = sz(s);
  8. res.clear();
  9. list<char>::iterator it = res.begin();
  10. rep(i, 0, n - 1) {
  11. if(s[i] == '<') {
  12. if(it != res.begin()) {
  13. it--;
  14. }
  15. } else if(s[i] == '>') {
  16. if(it != res.end()) {
  17. it++;
  18. }
  19. } else if(s[i] == '-') {
  20. if(it != res.begin()) {
  21. it--;
  22. it = res.erase(it);
  23. }
  24. } else {
  25. res.insert(it, s[i]);
  26. }
  27. }
  28. fore(x, res) {
  29. cout << x;
  30. }
  31. cout << endl;
  32. }
  33. return 0;
  34. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:1:1: error: 'string' does not name a type
 string s;
 ^
prog.cpp:2:1: error: 'list' does not name a type
 list<char> res;
 ^
prog.cpp: In function 'int main()':
prog.cpp:4:3: error: 'boost' was not declared in this scope
   boost;
   ^
prog.cpp:5:3: error: 'tcase' was not declared in this scope
   tcase {
   ^
stdout
Standard output is empty