Unnamed
public text v1 · immutableprogram lab6;
uses crt;
type
mas = array [1..10,1..10] of integer;
var
x,y,i,j: integer;
a,b: mas;
begin
clrscr;
writeln('vvedite kolichestvo strok i stolbcov');
readln(x,y);
if (x<=0) or (y<=0) then
writeln('x & y dolznbl bblt polozitelnblmi')
else
begin
writeln('vvedite elementbl massiva');
for i:=1 to x do
for j:=1 to y do
readln(a[i,j]);
writeln('isgodnaya matrica:');
for i:=1 to x do
begin
writeln;
for j:=1 to y do
write(a[i,j]:5);
end;
for i:=1 to x do
for j:=1 to y do
b[i,j]:=a[i,j];
for i:=1 to x do
for j:=1 to y do
if (a[i,j] > a[i-1,j-1]) and (a[i,j] > a[i,j-1]) and
(a[i,j] > a[i+1,j-1]) and
(a[i,j] > a[i-1,j]) and (a[i,j] > a[i-1,j+1])
and (a[i,j] > a[i,j+1]) and
(a[i,j] > a[i+1,j]) and (a[i,j] > a[i+1,j+1]) then
b[i,j]:=1;
writeln;
writeln('preobrazovannaya matrica:');
for i:=1 to x do
begin
writeln;
for j:=1 to y do
write(b[i,j]:5);
end;
end;
readln;
end.