Код
Uses crt;
Var
a:array [1..100,1..100] of integer;
i,l,n,k,s,c,m,j,ns:integer;
f:boolean;
Begin
clrscr;
writeln('vvedite n');
readln(n);
writeln('vvedite m');
readln(m);
writeln('vvedite matrizy');
for i:=1 to n do
begin
for j:=1 to m do
begin
write('a[',i,',',j,']');
readln(a[i,j]);
end;
writeln;
end;
{-----------------------------------------}
l:=n; f:=false;
for i:=1 to n do
begin
c:=0;
for j:=1 to m do
begin
S:=0;
for k:=1 to (a[i,j]-1) do if a[i,j]mod k=0 then s:=s+k;
if a[i,j]=s then c:=c+1;
end;
if (c<=l) and (c<>0) then
begin
l:=c;
ns:=i;
f:=true
end;
end;
{------------------------------------------------------}
if f then
begin
writeln('pechat stroki');
for j:=1 to m do
write (a[ns,j]:5);
end
else write('takih net');
readln;
end.