uses crt;
var a: array[1..100] of longint;
i,n,ta,td,d: longint;
begin
clrscr;
write ('nhap so phan tu cua mang: '); readln (n);
for i:=1 to n do
begin
write ('nhap a[',i,']: '); readln (a[i]);
if a[i]<0 then ta:=ta+a[i];
if a[i]>0 then td:=td+a[i];
if a[i]=0 then d:=d+1;
end;
write ('cac so chan la: ');
for i:=1 to n do if a[i] mod 2=0 then write(i,' ');
write ('cac so le la: ');
for i:=1 to n do if a[i] mod 2<>0 then write(i,' ');
writeln ('tong cac so am: ',ta);
writeln ('tong cac so duong: ',td);
writeln ('co ',d,' so 0 trong day so');
readln;
end.
😏😏😏😎😎😎
học tốt