fork download
  1. Push(S, x)
  2. if top[S] = length[S]
  3. then error "overflow"
  4. else top[S] <- top[S] + 1
  5. S[top[S]] <- x;
  6.  
  7. Pop(S)
  8. if top[S] = 0
  9. then error "underflow"
  10. else top[S] <- top[S] - 1
  11. return S[top[S] + 1]
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
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)
    ^
stdout
Standard output is empty