1.
Program HOC24;
var a: array[1..32000] of longint;
i,n: integer;
tc,tl: longint;
begin
write('Nhap N: '); readln(n);
tc:=0; tl:=0;
for i:=1 to n do
begin
write('a[',i,']='); readln(a[i]);
if a[i] mod 2=0 then tc:=tc+a[i];
if a[i] mod 2=1 then tl:=tl+a[i];
end;
writeln('Tong chan la: ',tc);
write('Tong le la: ',tl);
readln
end.
2.
Program HOC24;
var a: array[1..32000] of longint;
d1,d2,i,n: integer;
begin
write('Nhap N: '); readln(n);
d1:=0; d2:=0;
for i:=1 to n do
begin
write('a[',i,']='); readln(a[i]);
if a[i] >0 then d1:=d1+1;
if a[i] <0 then d2:=d2+1;
end;
writeln('Co ',d1,' so lon hon 0');
write('Co ',d2,' so be hon 0');
readln
end.