Problem sumstack
User hitarthdangra
Submission Time 2025-06-17 16:33:01
Score 0
Max Time N/A
Max Memory N/A

Compile Error

sumstack.cpp: In function ‘int main()’:
sumstack.cpp:35:23: error: ‘temp’ was not declared in this scope
35 | int val = temp.top();
| ^~~~
sumstack.cpp:37:18: error: no post-increment operator for type
37 | count++;
| ^~
sumstack.cpp:38:26: error: ‘x’ was not declared in this scope
38 | if (count <= x) {
| ^
sumstack.cpp:39:17: error: ‘sum’ was not declared in this scope
39 | sum += val;
| ^~~
sumstack.cpp:45:21: error: ‘sum’ was not declared in this scope
45 | cout << sum;
| ^~~
sumstack.cpp: At global scope:
sumstack.cpp:47:5: error: expected declaration before ‘}’ token
47 | }
| ^
sumstack.cpp:49:5: error: expected unqualified-id before ‘return’
49 | return 0;
| ^~~~~~