program ct;
uses crt;
var i,n,s,T,Tam,Max,Min,j:integer;
tbc:real;
A:array[1..100] of integer;
begin
clrscr;
write('nhap n:=');readln(n);
for i:=1 to n do
begin
write('nhap mang A[',i,']:=');readln(A[i]);
end;
Max:=A[1];Min:=A[1];s:=0;T:=0;
for i:=1 to n do
begin
if Max<A[i] then Max:=A[i];
if Min>A[i] then Min:=A[i];
s:=s+A[i];
tbc:=s/n;
if A[i] mod 2=0 then T:=T+A[i];
end;
writeln('so lon nhat la:',Max);
writeln('so nho nhat la:',Min);
writeln('trung binh cong la:',tbc);
writeln('tong la:',s);
writeln('tong cac so chan la:',T);
for i:=1 to n-1 do
for j:=i+1 to n do
A[i]>A[j] then
begin
Tam:=A[i];
A[i]:=A[j];
A[j]:=Tam;
end;
writeln('day so sap xep theo thu tu tang dan la');
for i:=1 to n do
write(A[i],' ');
readln
end.