uses crt;
var a:array[1..100]of integer;
i,n,t1,t2:integer;
begin
clrscr;
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
for i:=1 to n do
write(a[i]:4);
writeln;
writeln('Cac phan tu am la: ');
t1:=0;
for i:=1 to n do
if a[i]<0 then
begin
write(a[i]:4);
t1:=t1+a[i];
end;
writeln;
writeln('Cac phan tu le la: ');
t2:=0;
for i:=1 to n do
if a[i] mod 2<>0 then
begin
write(a[i]:4);
t2:=t2+a[i];
end;
writeln;
writeln('Tong cac phan tu am la: ',t1);
writeln('Tong cac phan tu le la: ',t2);
readln;
end.