// PascalABC.NET 3.1, сборка 1239 от 08.05.2016 begin var b:array[1..6,1..6] of integer:=( (19,21,23,25,27,29),(57,59,61,63,65,31), (55,81,83,85,67,33),(53,79,89,87,69,35), (51,77,75,73,71,37),(49,47,45,43,41,39)); var a:array[1..6,1..6] of integer; var k:=2; var k0,k1:integer; for var i:=1 to 6 do begin for var j:=1 to 6 do Print(b[i,j]); Writeln end; Writeln; repeat k0:=0; k1:=0; Writeln('k=',k); for var i:=1 to 6 do begin for var j:=1 to 6 do begin if (b[i,j] mod k) mod 2=0 then begin a[i,j]:=1; Inc(k1) end else begin a[i,j]:=0; Inc(k0) end; Print(a[i,j]) end; Writeln end; Writeln('k0=',k0,', k1=',k1); if k0<>k1 then Inc(k) until k0=k1; Writeln(NewLine,'k=',k) end.
begin
var b:array[1..6,1..6] of integer:=(
(19,21,23,25,27,29),(57,59,61,63,65,31),
(55,81,83,85,67,33),(53,79,89,87,69,35),
(51,77,75,73,71,37),(49,47,45,43,41,39));
var a:array[1..6,1..6] of integer;
var k:=2;
var k0,k1:integer;
for var i:=1 to 6 do begin
for var j:=1 to 6 do Print(b[i,j]);
Writeln
end;
Writeln;
repeat
k0:=0;
k1:=0;
Writeln('k=',k);
for var i:=1 to 6 do begin
for var j:=1 to 6 do begin
if (b[i,j] mod k) mod 2=0 then
begin a[i,j]:=1; Inc(k1) end
else begin a[i,j]:=0; Inc(k0) end;
Print(a[i,j])
end;
Writeln
end;
Writeln('k0=',k0,', k1=',k1);
if k0<>k1 then Inc(k)
until k0=k1;
Writeln(NewLine,'k=',k)
end.
Решение
19 21 23 25 27 29
57 59 61 63 65 31
55 81 83 85 67 33
53 79 89 87 69 35
51 77 75 73 71 37
49 47 45 43 41 39
k=2
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
k0=36, k1=0
k=3
0 1 1 0 1 1
1 1 0 1 1 0
0 1 1 0 0 1
1 0 1 1 1 1
1 1 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