iliya785

stack

May 22nd, 2012
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.26 KB | None | 0 0
  1. const size = 100000;
  2. var stack:array[1..size] of longint;
  3.     i,j,n,e,b,a:longint;
  4. procedure push(a:longint);
  5.  begin
  6.   inc(e); stack[e]:=a;
  7.  end;
  8. procedure pop;
  9.  begin
  10.   dec(e);
  11.  end;
  12. Begin
  13. read(n);
  14. for i:=1 to n do
  15.  begin
  16.   read(a); push(a);
  17.  end;
  18. end.
Advertisement
Add Comment
Please, Sign In to add comment