program PSMCG;
uses crt;
const N = 5;
type MangA = array[1..N] of integer;
var A: MangA;
i, max, min, sum: integer;
begin
for i := 1 to N do
begin
write('Nhap phan tu A[', i, ']: ');
readln(A[i]);
end;
writeln('Mang A: ');
for i := 1 to N do
begin
write(A[i], ' ');
end;
writeln;
max := A[1];
min := A[1];
for i := 2 to N do
begin
if A[i] > max then max := A[i];
if A[i] < min then min := A[i];
end;
writeln('Gia tri lon nhat la: ', max);
writeln('Gia tri nho nhat la: ', min);
sum := 0;
for i := 1 to N do
begin
sum := sum + A[i];
end;
writeln('Tong gia tri trong mang A la: ', sum);
readln;
end.