Эта программа по поиску максимальных элементов в каждом столбце, а мне нужно в каждой строке. Спасибо const N = 5; M = 4;
var
arr: array[1..N,1..M] of byte;
i,j,max: byte;
begin
randomize;
for i:=1 to N do begin
for j:=1 to M do begin
arr[i,j] := random(256);
write(' |',arr[i,j]:3,'| ');
end;
writeln;
end;
for i:=1 to M do
write(' -----');
writeln;
for j:=1 to M do begin
max := arr[1,j];
for i:=2 to N do
if arr[i,j] > max then
max := arr[i,j];
write(' ',max:3,' ');
end;
writeln;
end.
Please enter comments
Please enter your name.
Please enter the correct email address.
You must agree before submitting.

Copyright © 2024 SCHOLAR.TIPS - All rights reserved.