Procedure sovp; var i, j, r, c: byte; ar: array[1..10, 1..10]of byte; s: array[1..4] of string; b: boolean; label l1; begin r := random(2, 3); l1: c := 1; b := false; for i := 1 to 10 do for j := 1 to 10 do begin ar[i, j] := random(0, 1); if(i < 5) then s[i] := ''; end; for i := 1 to 9 do begin for j := 1 to 10 do begin if(ar[i, j] <> ar[i + 1, j]) then b := true; end; if(b = false) then begin s[c] := i + ' строка совпалает с ' + (i + 1) + ' строкой'; c := c + 1; end; b := false; end; if(c <> r) then goto l1 else begin for var k := 1 to c do if(k<>c)then writeln(s[k]); for i := 1 to 10 do begin for j := 1 to 10 do write(ar[i, j], ' '); writeln; end; end; end; begin sovp; end.
Var i, j, max, n, m: integer; ar: array[,]of integer; begin readln(n, m); setlength(ar, n, m); for i := 0 to n - 1 do for j := 0 to m - 1 do ar[i, j] := random(0, 100); max := ar[0, 0]; for i := 0 to n - 1 do begin for j := 0 to m - 1 do begin if(ar[i, j] > max) then max := ar[i, j]; end; end; writeln('Максимальный элемент: ', max); for i := 0 to n - 1 do begin for j := 0 to m - 1 do write(ar[i, j]:4, ' '); writeln; end; end.
var
i, j, r, c: byte;
ar: array[1..10, 1..10]of byte;
s: array[1..4] of string;
b: boolean;
label l1;
begin
r := random(2, 3);
l1:
c := 1;
b := false;
for i := 1 to 10 do
for j := 1 to 10 do
begin
ar[i, j] := random(0, 1);
if(i < 5) then s[i] := '';
end;
for i := 1 to 9 do
begin
for j := 1 to 10 do
begin
if(ar[i, j] <> ar[i + 1, j]) then b := true;
end;
if(b = false) then
begin
s[c] := i + ' строка совпалает с ' + (i + 1) + ' строкой';
c := c + 1;
end;
b := false;
end;
if(c <> r) then goto l1
else
begin
for var k := 1 to c do if(k<>c)then writeln(s[k]);
for i := 1 to 10 do
begin
for j := 1 to 10 do write(ar[i, j], ' ');
writeln;
end;
end;
end;
begin
sovp;
end.
i, j, max, n, m: integer;
ar: array[,]of integer;
begin
readln(n, m);
setlength(ar, n, m);
for i := 0 to n - 1 do
for j := 0 to m - 1 do ar[i, j] := random(0, 100);
max := ar[0, 0];
for i := 0 to n - 1 do
begin
for j := 0 to m - 1 do
begin
if(ar[i, j] > max) then max := ar[i, j];
end;
end;
writeln('Максимальный элемент: ', max);
for i := 0 to n - 1 do
begin
for j := 0 to m - 1 do write(ar[i, j]:4, ' ');
writeln;
end;
end.