1:
uses crt;
var a:array[1..100,1..100]of integer;
i,n,j,m,max,min:integer;
begin
clrscr;
write('Nhap n='); readln(n);
write('Nhap m='); readln(m);
for i:=1 to n do
for j:=1 to m do
begin
write('A[',i,',',j,']='); readln(a[i,j]);
end;
for i:=1 to n do
begin
for j:=1 to m do
write(a[i,j]:4);
writeln;
end;
max:=a[1];
min:=a[1];
for i:=1 to n do
for j:=1 to m do
begin
if max<a[i,j] then max:=a[i,j];
if min>a[i,j] then min:=a[i,j];
end;
writeln('Gia tri lon nhat la: ',max);
writeln('Gia tri nho nhat la: ',min);
readln;
end.