const n=7;
var a:array[1..n,1..n] of integer;
i,j:integer;
begin
for i:=1 to n do
for j:=1 to n do
if (i=j)or(j=n-i+1)
then a[i,j]:=1 else a[i,j]:=0;
for i:=1 to n do
begin
for j:=1 to n do write(a[i,j]:2);
writeln;
end;
end.
Результат:
1 0 0 0 0 0 1
0 1 0 0 0 1 0
0 0 1 0 1 0 0
0 0 0 1 0 0 0
0 0 1 0 1 0 0
0 1 0 0 0 1 0
1 0 0 0 0 0 1