Problem bracketex
User Kanish
Submission Time 2023-11-09 09:59:32
Score 0
Max Time N/A
Max Memory N/A

Compile Error

bracketex.cpp:14:49: error: empty character constant
14 | } else if (x == '}' && !s.empty() && s.top() == '') {
| ^~
bracketex.cpp:1:1: error: ‘stack’ does not name a type
1 | stack<char> s;
| ^~~~~
bracketex.cpp: In function ‘int main()’:
bracketex.cpp:5:2: error: ‘cin’ was not declared in this scope
5 | cin >> n;
| ^~~
bracketex.cpp:9:2: error: ‘s’ was not declared in this scope
9 | s.push(x);
| ^
bracketex.cpp:10:25: error: ‘s’ was not declared in this scope
10 | } else if (x == ')' && !s.empty() && s.top() == '(') {
| ^
bracketex.cpp:16:41: error: lvalue required as left operand of assignment
16 | } else if ((x == ')' || x = ']' || x == '}') && s.empty()) { cout<<"Invalid" << "\n";
| ^~~
bracketex.cpp:16:62: error: ‘cout’ was not de