uses crt;
var a:array[1..100]of integer;
i,n,dem,t1,t2:integer;
begin
clrscr;
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
t1:=0;
t2:=0;
dem:=0;
for i:=1 to n do
begin
if a[i]>0 then t1:=t1+a[i];
if a[i]<0 then t2:=t2+a[i];
if a[i]=0 then inc(dem);
end;
writeln('Tong cac so duong la: ',t1);
writeln('Tong cac so am la: ',t2);
writeln('So so 0 la: ',dem);
readln;
end.
Program HOC24;
var i,n,d: integer;
a: array[1..32000] of integer;
t1,t,t0: longint;
begin
write('Nhap N: '); readln(n);
t:=0; t0:=0; t1:=0;
for i:=1 to n do
begin
write('a[',i,']='); readln(a[i]);
if a[i]>0 then t:=t+a[i];
if a[i]<0 then t1:=t1+a[i];
if ai=0 then t0:=t0+1;
end;
writeln('Tong cac so duong la: ',t);
writeln('Tong cac so am la: ',t1);
write('Co ',t0,' so 0 trong day');
readln
end.