Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program lab6_1a;
- type
- dane_os = record
- imie:string[80];
- nazwisko:string[80];
- end;
- wsk_dane = ^dane_os;
- const
- MaxN = 100;
- var
- tab:array[0..MaxN-1] of wsk_dane;
- i,k:integer;
- begin
- while true do
- begin
- writeln('Podaj indeks rekordu: ');
- read(i);
- if not (i in [0..MaxN-1]) then
- break;
- if tab[i]<>nil then
- writeln('Tab[',i,'] jest zajete')
- else
- begin
- tab[i]:=new(wsk_dane);
- write('Podaj IMIE do rekordu ',i,': ');
- readln(tab[i]^.imie);
- write('Podaj NAZWISKO do rekordu ',i,': ');
- readln(tab[i]^.nazwisko);
- end;
- end;
- for k:=0 to MaxN-1 do
- if tab[k]<>nil then
- begin
- writeln('imie: ',tab[k]^.imie,' nazwisko: ',tab[k]^.nazwisko);
- dispose(tab[k]);
- end;
- readln;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement