Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package body pila is
- top : Integer := 0;
- stack: array (1..100) of Integer;
- function Empty return Boolean is
- begin
- return top = 0;
- end Empty;
- procedure Push(E:Elemento) is
- begin
- if (top /= 100) then
- top := top + 1;
- stack(top) := Integer(E);
- end if;
- end Push;
- procedure Pop(E: out Elemento) is
- begin
- E := Elemento(stack(top));
- top := top - 1;
- end Pop;
- end pila;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement