Const
n = 10;
m = 10;
type
Matrix = array[1..n, 1..m] of integer;
procedure EnterMas(var Mas: Matrix);
var i, j: integer;
begin
randomize;
for i := 1 to n do
for j := 1 to m do
Mas[i, j] := random(100);
end;
procedure GiveMas(var Mas: Matrix);
var i, j: integer;
begin
for i := 1 to n do
begin
for j := 1 to m do
begin
write(Mas[i, j], ' ');
end;
writeln;
end;
end;
function SumStroki(Mas: Matrix; i, k: integer): integer;
var
j, sum: integer;
begin
sum := 0;
for j := 1 to m do
Sum := Sum + Mas[i, j];
SumStroki := sum - k;
end;
function Element(var Mas: Matrix): integer;
var
i, j, count: integer;
begin
count := 0;
for i := 1 to n do
for j := 1 to m do
if Mas[i, j] > SumStroki(Mas, i, Mas[i, j]) then inc(count);
Element := count;
end;
var Mas: Matrix;
Sum, Max: integer;
begin
EnterMas(Mas);
GiveMas(Mas);
writeln('Кол-во особых элементов ', Element(Mas));
end.