Program prueba1;
uses Estructu;
Var Pila1:Pila; Fila1,Completa:Fila;
Begin
Inicfila (Completa);
readpila(Pila1);
readfila(Fila1);
While (not pilavacia(Pila1) and not filavacia(Fila1)) do
begin
if (tope(Pila1) > primero(Fila1)) then
begin
agregar(Completa, desapilar(Pila1))
else
if (tope(Pila1) < primero(Fila1)) then
begin
agregar(Completa, extraer(Fila1))
else
if (tope(Pila1) = primero(Fila1)) then
begin
agregar(Completa, desapilar(Pila1));
agregar(Completa, extraer(Fila1))
end
end
end
end
write('El resultado final de Completa es');
Writefila(Completa);
End.
The purpose of the program would be to organise in Completa all the variables from Pila1 and Fila1 in order from first to last. I don't know what I'm doing wrong and would appreciate the help