var array 100 100 of integer byte sp sg integer begin writeln Introduc

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
var a:array[1..100, 1..100] of integer;
i, j, m, n : byte;
s, sp, sg: integer;
begin
writeln('Introduceti dimensiunile matricei: ');
readln(m, n);
s:=0;
sp:=0;
sg:=0;
for i:=1 to m do
for j:=1 to n do begin
write('a[', i, ', ', j, ']='); readln(a[i, j]);
s:=s+a[i, j];
if a[i, j] > 0 then sp:=sp+a[i, j]; else sg:=sg+a[i, j];
end;
writeln('Suma elementelor: ', s);
writeln('Suma elementelor pozitive: ', sp);
writeln('Suma elementelor negative: ', sg);
readln;
end.
http://img2.pict.com/26/0a/cb/b88047b54633b0a3d85879f53a/gWkoS/sc.jpg