Advertisement
Guest User

Untitled

a guest
Mar 16th, 2019
262
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ada 0.68 KB | None | 0 0
  1. with pila, Ada.Text_IO, Ada.Integer_Text_IO;
  2. use pila, Ada.Text_IO, Ada.Integer_Text_IO;
  3. procedure Ejercicio_10_pila is
  4.     E:Elemento;
  5. begin
  6.    Put("Los elementos insertados son: [");
  7.    for i in 1..10 loop
  8.       E:=Elemento(i);
  9.       Push(E);
  10.       Put(E'Img);
  11.       if i /= 10 then
  12.          Put(", ");
  13.       else
  14.          Put("]");
  15.       end if;
  16.    end loop;
  17.    New_Line;
  18.    Put_Line("Se han insertado los 10 elementos en la cola");
  19.    
  20.    Put("Los elementos eliminados son: [");
  21.    while Empty = false loop
  22.       Pop(E);
  23.       Put(E'Img);
  24.       if Empty = false then
  25.          Put(", ");
  26.       else
  27.          Put("]");
  28.       end if;
  29.    end loop;
  30. end Ejercicio_10_pila;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement