Push(S, x) if top[S] = length[S] then error "overflow" else top[S] <- top[S] + 1 S[top[S]] <- x; Pop(S) if top[S] = 0 then error "underflow" else top[S] <- top[S] - 1 return S[top[S] + 1]
Standard input is empty
prog.cpp:1:5: error: expected constructor, destructor, or type conversion before '(' token Push(S, x) ^ prog.cpp:7:4: error: expected constructor, destructor, or type conversion before '(' token Pop(S) ^
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!