	 52						UniPASCAL - 㫨
	 

	      8.4.  ਬ ᯮ짮 㫥

	      ਢ  ਬ  ⢥ ᢮⢠ -
	 .   Stack ᯮ 楤  㭪, , -
	 ⢥⢥,     ⥪ .   
	 ⥪  ⢫ ⮫쪮 १  楤  㭪 -
	  ࠭஢  ࠢ쭮 㭪樮஢.

	 unit Stack; interface
	   var full:  boolean;
	       empty: boolean;
	   procedure push(x: word);
	   function  pull: word;
	 implementation
	   const StackSize = 100;
	   type StackIndex = 0..StackSize;
	   var curr: StackIndex;
	       StackArray: array [StackIndex] of word;
	   procedure push(x: word);
	   begin
	   if not full
	     then begin StackArray[curr]:= x;
		  Inc(curr);
		  end;
	   full:= StackSize <= curr;
	   empty:= false;
	   end; { push }
	   function pull: word;
	   begin
	   if not empty
	     then begin Dec(curr);
		  pull:= StackArray[curr];
		  end;
	   empty:= curr = 0;
	   full:= false;
	   end; { pull }
	 begin
	   curr:= 0; full:= false; empty:= true;
	 end. { Stack }

	         ணࠬ, ᯮ  Stack.

	 program UseStack;
	   uses Stack;
	   var i: integer;
	 begin
	   i:= 0;
	   while not full do
	     begin push(i);
	     inc(i);
	     end;
	   while not empty do
	     writeln(pull);
	 end.
