uses crt;
var a:array[1..100]of integer;
i,n,t,max:integer;
begin
clrscr;
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
t:=0;
for i:=1 to n do
if a[i]<0 then t:=t+a[i];
writeln('Tong cac so nguyen am la: ',t);
max:=a[1];
for i:=1 to n do
if max<a[i] then max:=a[i];
writeln('So lon nhat la: ',max);
writeln('Vi tri cua so lon nhat la: ');
for i:=1 to n do
if a[i]=max then write(i:4);
readln;
end.