:

- PUSH ( s , i ) - , s - , i - , ;

- POP ( s ) - . , ;

- EMPTY ( s ) - (true - , false - );

- STACKTOP ( s ) - .

( )

Program STACK;

const

max_st=50;

const

max_st=50;

var

st,st2: array[1..max_st] of integer;

n:integer;

function empty:boolean; { }

begin

empty:=n=0

end;

procedure push(a:char); { }

begin

inc(n);

st[n]:=a;

end;

procedure pop(var a:char); { }

begin

a:=st[n];

dec(n);

end;

function full:boolean; { }

begin

Full:=n=max_st

end;

procedure stacktop(var a:char); { }

begin

a:=st[n];

end;

begin { }

.

.

end.