program SoMinMaxTrongMang;
var
A: array [1..50] of Integer;
n, i, min, max: Integer;
begin
Write('Nhap so phan tu cua mang: ');
Readln(n);
for i := 1 to n do
begin
Write('A[', i, ']= ');
Readln(A[i]);
end;
min := A[1];
max := A[1];
for i := 2 to n do
begin
if A[i] < min then
min := A[i];
if A[i] > max then
max := A[i];
end;
WriteLn('So lon nhat trong mang la: ', max);
WriteLn('So nho nhat trong mang la: ', min);
end.