program matrice_suma_negative;
type matrice=array[1..5,1..5] of integer;
var a:matrice;
i,j,s:integer;
begin
{citirea elementelor tabloului}
for i:=1 to 5 do
for j:=1 to 5 do
begin
write('a[',i,',',j,']=');readln(a[i,j]); end;
{initializare suma}
s:=0;
for i:=1 to 5 do
for j:=1 to 5 do
begin
if a[i,j]<0 then
s:=s+a[i,j]; {calcul suma}
end;
{afisaj}
writeln('Suma este:',s);
readln;
end.