Const n=3; var ma:array[1..n,1..n] of integer; i,j,p:integer; begin; p:=0; randomize; writeln('Matrix:'); for i:=1 to n do begin; writeln; for j:=1 to n do begin; ma[i,j]:=random(2); write(ma[i,j]:4); end; end; writeln; for i:=1 to n do if ma[i,1]<>ma[i,n] then p:=1; if p=0 then write('Да') else write('Нет'); end.
n=3;
var
ma:array[1..n,1..n] of integer;
i,j,p:integer;
begin;
p:=0;
randomize;
writeln('Matrix:');
for i:=1 to n do
begin;
writeln;
for j:=1 to n do
begin;
ma[i,j]:=random(2);
write(ma[i,j]:4);
end;
end;
writeln;
for i:=1 to n do
if ma[i,1]<>ma[i,n] then p:=1;
if p=0 then write('Да') else write('Нет');
end.