Problem bracketex
User Kanish
Submission Time 2023-11-09 10:08:18
Score 0
Max Time N/A
Max Memory N/A

Compile Error

bracketex.cpp:5:1: error: ‘stack’ does not name a type; did you mean ‘obstack’?
5 | stack<char> s;
| ^~~~~
| obstack
bracketex.cpp: In function ‘int main()’:
bracketex.cpp:13:2: error: ‘s’ was not declared in this scope
13 | s.push(x);
| ^
bracketex.cpp:14:25: error: ‘s’ was not declared in this scope
14 | } else if (x == ')' && !s.empty() && s.top() == '(') {
| ^
bracketex.cpp:20:41: error: lvalue required as left operand of assignment
20 | } else if ((x == ')' || x = ']' || x == '}') && s.empty()) { cout<<"Invalid" << "\n";
| ^~~
bracketex.cpp:24:5: error: ‘s’ was not declared in this scope
24 | if (s.empty())
| ^
bracketex.cpp:27:1: error: expected primary-expression before ‘}’ token
27 | }
| ^
bracketex.cpp: At global scope:
bracketex.cpp:28:1: error: ‘cout’ does not name a