Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program NAZWA_PROGRAMU;
- {$APPTYPE CONSOLE}
- uses SysUtils;
- TYPE PElem = ^TElem;
- TElem = RECORD
- imie : string;
- nazwisko : string;
- wsk :PElem;
- END;
- VAR poczatek,koniec:PElem;
- n:integer;
- temp,q:PElem;
- procedure WypiszKolejke;
- begin
- WHILE poczatek<>NIL DO
- begin
- temp:=poczatek^.wsk;
- writeln('Imie pacjenta: ',poczatek^.imie);
- writeln('Nazwisko pacjenta: ',poczatek^.nazwisko);
- writeln;
- poczatek:=temp;
- end; writeln;
- end;
- procedure TworzKolejke(n:integer);
- var k:integer;
- begin
- poczatek:=NIL; koniec:=NIL;
- k:=n;
- WHILE k>0 DO
- begin
- NEW(q);
- q^.wsk:=poczatek;
- poczatek:=q;
- writeln('Imie pacjenta?');
- readln(poczatek^.imie);
- writeln('Nazwisko pacjenta?');
- readln(poczatek^.nazwisko);
- writeln;
- IF k=n THEN koniec:=poczatek;
- k:=k-1;
- end;
- end;
- Begin
- write('Podaj jak dluga jest kolejka pacjentow ');
- readln(n);
- TworzKolejke(n);
- WypiszKolejke;
- readln;
- End.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement