uses crt;
const n=4;
type rec=record
name:string;
pl:integer;
end;
var x:array[1..n] of rec;
i:integer;
procedure Sort;
var i,imin,j,k:integer;
tmp:rec;
begin
for i:=1 to n-1 do
begin
imin:=i;
for j:=i+1 to n do
if x[j].pl>x[imin].pl then
imin:=j;
if imin<>i then
begin
tmp:=x[i];
x[i]:=x[imin];
x[imin]:=tmp;
end;
end;
end;
begin
ClrScr;
for i:=1 to n do
with x[i] do
begin
Write(' Name: ');
Readln(name);
Write(' Plotnost: ');
Readln(pl);
end;
Writeln('-------------------');
Writeln('|| Name | PL ||');
Writeln('-------------------');
for i:=1 to n do
Writeln('||',x[i].name:8,'|',x[i].pl:6,'||');
Writeln('-------------------');
Sort;
for i:=1 to n do
Writeln(i,': ',x[i].name);
Readln;
end.