uses crt;
const n=5;
var a:array[1..n,1..n]of integer;
i,j,max,k,t:integer;
begin
clrscr;
randomize;
writeln('Исходный массив');
for i:=1 to n do
begin
for j:=1 to n do
begin
a[i,j]:=random(100);
write(a[i,j]:3);
end;
writeln;
end;
write('K -> ');
readln(k);
max:=-1;
t:=0;
for i:=1 to n do for j:=1 to n do if a[i,j] mod k=0 then
begin
inc(t);
if a[i,j]>max then max:=a[i,j];
end;
write(k);
writeln('MAX=',max);
readln;
end.
const n=5;
var a:array[1..n,1..n]of integer;
i,j,max,k,t:integer;
begin
clrscr;
randomize;
writeln('Исходный массив');
for i:=1 to n do
begin
for j:=1 to n do
begin
a[i,j]:=random(100);
write(a[i,j]:3);
end;
writeln;
end;
write('K -> ');
readln(k);
max:=-1;
t:=0;
for i:=1 to n do for j:=1 to n do if a[i,j] mod k=0 then
begin
inc(t);
if a[i,j]>max then max:=a[i,j];
end;
write(k);
writeln('MAX=',max);
readln;
end.