uses crt;
var a:array[1..100]of integer;
i,n,max,min,t: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;
max:=a[1];
min:=a[1];
for i:=1 to n do
begin
if max<a[i] then max:=a[i];
if min>a[i] then min:=a[i];
end;
writeln(max);
writeln(min);
readln;
end.
t:=0;
for i:=1 to n do
if a[i]<>0 then t:=t+a[i];
writeln(t);
readln;
end.