Const nn=50; var i,j,n:integer; a:array[1..nn,1..nn] of integer; begin Write('n='); Read(n); for i:=1 to n do begin for j:=1 to n do if (i+j) mod 2 =0 then Write('0') else Write('1'); Writeln end end.
Const n=5; var A:array[1..n,1..n] of integer; i,j:integer;
begin
for i:=1 to n do begin writeln; for j:=1 to n do begin if (odd(i) and odd(j)) or (not odd(i) and not odd(j)) then a[i,j]:=0 else a[i,j]:=1; write(a[i,j]:3); end; end;
nn=50;
var
i,j,n:integer;
a:array[1..nn,1..nn] of integer;
begin
Write('n='); Read(n);
for i:=1 to n do begin
for j:=1 to n do
if (i+j) mod 2 =0 then Write('0') else Write('1');
Writeln
end
end.
Тестовое решение
n=8
01010101
10101010
01010101
10101010
01010101
10101010
01010101
10101010
var A:array[1..n,1..n] of integer;
i,j:integer;
begin
for i:=1 to n do
begin
writeln;
for j:=1 to n do
begin
if (odd(i) and odd(j)) or (not odd(i) and not odd(j)) then a[i,j]:=0
else a[i,j]:=1;
write(a[i,j]:3);
end;
end;
end.