program mas2_min_max;
const
n=8;
var
a:array[1..n,1..n] of integer;
i,j,max,min:integer;
begin
writeln('Массив 》');
for i:=1 to n do
for j:=1 to n do
a[i,j]:=random(21)-10;
write(a[i,j]:3,' ');
end;
writeln;
min:=a[1,1];
max:=a[1,1];
if min<a[i,j] then
min:=a[i,j];
if max>a[i,j] then
max:=a[i,j];
writeln('Минимальный элемент 》',min);
writeln('Максимальный элемент 》',max);
end.
Copyright © 2025 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
program mas2_min_max;
const
n=8;
var
a:array[1..n,1..n] of integer;
i,j,max,min:integer;
begin
writeln('Массив 》');
for i:=1 to n do
begin
for j:=1 to n do
begin
a[i,j]:=random(21)-10;
write(a[i,j]:3,' ');
end;
writeln;
end;
min:=a[1,1];
max:=a[1,1];
for i:=1 to n do
for j:=1 to n do
begin
if min<a[i,j] then
min:=a[i,j];
if max>a[i,j] then
max:=a[i,j];
end;
writeln('Минимальный элемент 》',min);
writeln('Максимальный элемент 》',max);
end.