Program HOC24;
var max,min,i,n: integer;
t,tc: longint;
a: array[1..32000] of integer;
begin
write('Nhap n='); readln(n);
max:=0; min:=32000; t:=0; tc:=0;
for i:=1 to n do
begin
write('a[',i,']='); readln(a[i]);
if a[i]>max then max:=a[i];
if a[i]<min then min:=a[i];
t:=t+a[i];
if a[i] mod 2=0 then tc:=tc+a[i];
end;
write('Mang da nhap la : ');
for i:=1 to n do write(a[i],' ');
writeln;
writeln('Gia tri lon nhat la ',max,' ; gia tri nho nhat la ',min);
write('Cac so le trong mang la : ');
for i:=1 to n do if a[i] mod 2<>0 then write(a[i],' ');
writeln;
write('Cac so chan trong mang la : ');
for i:=1 to n do if a[i] mod 2=0 then write(a[i],' ');
writeln;
writeln('Tong cua mang A la : ',t);
write('Tong cac so chan co trong mang la : ',tc);
readln
end.