<span>program ves;
const
A1='легкая категория';
A2='средняя категория';
var
b : integer;
begin
write('введите вес спортсмена *пусто* = ');
readln(b);
if b < 59 then writeln(A1) else writeln(A2);
readln;
end.</span>
Const n=3;
type lec=record
name:string;
cost:integer;
end;
var a:array [1..n] of lec;
max1:integer;
m,k,p,i:byte;
begin
for i:=1 to n do
with a[i] do begin
writeln ('Введи наименование товара');
readln (name);
writeln ('введи стоимость товара');
readln (cost);
end;
max1:=-1;
for i:=1 to n do
if a[i].cost>max1 then begin max1:=a[i].cost;
p:=i;
end;
while k<>1 do begin
for i:=1 to n do
if (i<>p) and (a[i].cost=max1) then begin m:=i;
k:=1;
end;
max1:=max1-1;
end;
writeln (a[p].name,' ',a[p].cost);
write (a[m].name,' ',a[m].cost);
readln;
end.
// PascalABC.NET 3.0, сборка 1160 от 05.02.2016
begin
SeqRandom(ReadInteger('n='),1,99).Println
end.
<u><em>Тестовое решение:</em></u>
n= 30
8 39 37 3 4 57 33 31 44 12 32 80 14 19 73 64 81 82 36 6 48 12 84 81 6 66 36 51 40 69