program bai_tap;
uses crt;
var a:array[1..10] of integer;
n,i:byte;
s,max,min:integer;
begin
clrscr;
write('nhap so luong phan tu cua mang: ');
readln(n);
for i:= 1 to n do
begin
write('nhap phan tu thu [',i,']= ');
readln(a[i]);
end;
{cau a) ======================}
writeln('mang ban vua nhap la: ')
for i:= 1 to n do
write(a[i]:4);
writeln;
{cau b) ======================}
s:=0;
for i:= 1 to n do
s:=s+a[i];
writeln('tong cac phan tu trong mang la: ',s);
{cau c) ======================}
max:=a[1];
for i:= 1 to n do
if max < a[i] then max:=a[i];
writeln('gia tri max la: ',max);
{cau d) ======================}
min:=a[i];
for i:= 1 to n do
if min > a[i] then min:=a[i];
writeln('gia tri nho nhat la: ',min);
readln
end.