|
Politica de confidentialitate |
|
• domnisoara hus • legume • istoria unui galban • metanol • recapitulare • profitul • caract • comentariu liric • radiolocatia • praslea cel voinic si merele da aur | |
COADA - PASCAL | ||||||
|
||||||
Def: Reprezinta o alta categorie speciala de lista liniara in care elementele
se adauga la un capat (la sfarsit) si se suprima la celalat capat (la
inceput). Se mai numeste si lista de tip FIFO (first in first out). d4n3nf Begin IF p = nil THEN Writeln(‘Coada e goala’) ELSE Begin Writeln(‘Putem sterge elemental ‘,p^.elem); c := p; p := c^.adr; dispose(c); end ; end; PROCEDURE listare(VAR p :lista) ; Begin IF p = nil THEN Write(‘ coada e goala ‘) ELSE Begin c := p; While c <> nil do Begin Writeln(c^.elem); c := c^.adr; end; End; End; Aprogram principalS BEGIN prim := nil; Acoada goalaS REPEAT Writeln(‘Pt intrare apasati I’); Writeln(‘Pt iesire apasati E’); Writeln(‘Pt listare apasati L’); Writeln(‘Pt parasire program apasati Q’); Readln(r); CASE upcase (r ) OF ‘I’ : intrare(prim,ultim); ‘E’ : iesire(prim); ‘L’ : listare (prim); end; UNTIL upcase( r ) = ’Q’; END. |
||||||
|
||||||
|
||||||
Copyright© 2005 - 2024 | Trimite document | Harta site | Adauga in favorite |
|