Const n=5; m=6;
var
a:array[1..n,1..m] of integer;
i,j,k,max:integer;
begin
Randomize;
writeln('Исходный массив:');
for i:=1 to n do
begin
for j:=1 to m do
begin
a[i,j]:=random(100);
write(a[i,j]:4);
end;
writeln;
end;
max:=0;
for i:=1 to n do
begin
k:=0;
for j:=1 to m do
if a[i,j] mod 5=0 then k:=k+1;
writeln(i,': ',k);
if k>max then max:=k;
end;
writeln('max = ',max);
end.
Пример:
Исходный массив:
23 5 72 8 28 14
25 78 62 10 61 35
61 30 19 58 98 29
94 36 58 51 90 10
34 82 47 92 41 45
1: 1
2: 3
3: 1
4: 2
5: 1
max = 3