Вводятся три одномерных массива а(15), в(20), с(10). найти тот массив, который имеет наименьшее значение максимального по абсолютной величине элемента. вывести на печать массив и максимальный по модулю элемент.
var a: array[1..15] of integer; b: array[1..20] of integer; c: array[1..10] of integer; i, maxa, maxb, maxc: integer;
begin maxa := 0; for i := 1 to 15 do begin read(a[i]); if abs(a[i]) > maxa then maxa := abs(a[i]); end; maxb := 0; for i := 1 to 20 do begin read(b[i]); if abs(b[i]) > maxb then maxb := abs(b[i]); end; maxc := 0; for i := 1 to 10 do begin read(c[i]); if abs(c[i]) > maxc then maxc := abs(c[i]); end; if (maxa > maxb) and (maxa > maxc) then begin for i := 1 to 15 do write(a[i], ' ');writeln;writeln(maxa); end else if (maxb > maxa) and (maxb > maxc) then begin for i := 1 to 20 do write(b[i], ' ');writeln;writeln(maxb); end else if (maxc > maxb) and (maxc > maxa) then begin for i := 1 to 10 do write(c[i], ' ');writeln;writeln(maxc); end; end.
var
a: array[1..15] of integer;
b: array[1..20] of integer;
c: array[1..10] of integer;
i, maxa, maxb, maxc: integer;
begin
maxa := 0;
for i := 1 to 15 do
begin
read(a[i]);
if abs(a[i]) > maxa then maxa := abs(a[i]);
end;
maxb := 0;
for i := 1 to 20 do
begin
read(b[i]);
if abs(b[i]) > maxb then maxb := abs(b[i]);
end;
maxc := 0;
for i := 1 to 10 do
begin
read(c[i]);
if abs(c[i]) > maxc then maxc := abs(c[i]);
end;
if (maxa > maxb) and (maxa > maxc) then begin for i := 1 to 15 do write(a[i], ' ');writeln;writeln(maxa); end
else if (maxb > maxa) and (maxb > maxc) then begin for i := 1 to 20 do write(b[i], ' ');writeln;writeln(maxb); end
else if (maxc > maxb) and (maxc > maxa) then begin for i := 1 to 10 do write(c[i], ' ');writeln;writeln(maxc); end;
end.