Program Premier_liga_2;
var B, Diff: array [1..16] of integer;
Team: array[1..16] of string;
I, K, X, Z, P: integer;
St: string;
begin
writeln('Введите названия команд и полученные ими очки');
for I:=1 to 16 do
write(I, ' Название: '); readln(Team[I]);
write('Очки: '); readln(B[I]);
write('Забитые мячи: '); readln(Z);
write('Пропущенные мячи: '); readln(P);
Diff[I]:= Z-P;
end;
for K:=1 to 15 do
for I:=1 to 16-K do
if (B[i] < B[I+1]) or
((B[i] = B[I+1]) and (Diff[i] < Diff[I+1])) then
X:=B[I]; B[I]:=B[I+1]; B[I+1]:=X;
St:=Team[I]; Team[I]:=Team[I+1];
Team[I+1]:=St;
for K:=1 to 18-length(Team[I]) do
Team[I]:=Team[I]+' ';
writeln(I:2,' ',Team[I]:18,B[I]:2)
end.
Program Premier_liga_2;
var B, Diff: array [1..16] of integer;
Team: array[1..16] of string;
I, K, X, Z, P: integer;
St: string;
begin
writeln('Введите названия команд и полученные ими очки');
for I:=1 to 16 do
begin
write(I, ' Название: '); readln(Team[I]);
write('Очки: '); readln(B[I]);
write('Забитые мячи: '); readln(Z);
write('Пропущенные мячи: '); readln(P);
Diff[I]:= Z-P;
end;
for K:=1 to 15 do
for I:=1 to 16-K do
if (B[i] < B[I+1]) or
((B[i] = B[I+1]) and (Diff[i] < Diff[I+1])) then
begin
X:=B[I]; B[I]:=B[I+1]; B[I+1]:=X;
St:=Team[I]; Team[I]:=Team[I+1];
Team[I+1]:=St;
end;
for I:=1 to 16 do
begin
for K:=1 to 18-length(Team[I]) do
Team[I]:=Team[I]+' ';
writeln(I:2,' ',Team[I]:18,B[I]:2)
end;
end.
Program Premier_liga_2;
var B, Diff: array [1..16] of integer;
Team: array[1..16] of string;
I, K, X, Z, P: integer;
St: string;
begin
writeln('Введите названия команд и полученные ими очки');
for I:=1 to 16 do
begin
write(I, ' Название: '); readln(Team[I]);
write('Очки: '); readln(B[I]);
write('Забитые мячи: '); readln(Z);
write('Пропущенные мячи: '); readln(P);
Diff[I]:= Z-P;
end;
for K:=1 to 15 do
for I:=1 to 16-K do
if (B[i] < B[I+1]) or
((B[i] = B[I+1]) and (Diff[i] < Diff[I+1])) then
begin
X:=B[I]; B[I]:=B[I+1]; B[I+1]:=X;
St:=Team[I]; Team[I]:=Team[I+1];
Team[I+1]:=St;
end;
for I:=1 to 16 do
begin
for K:=1 to 18-length(Team[I]) do
Team[I]:=Team[I]+' ';
writeln(I:2,' ',Team[I]:18,B[I]:2)
end;
end.