Заполнить двухмерный массив размером 6 × 6 следующим образом:
1 1 1 1 1 1
1 1 0 0 0 1
1 0 1 0 0 1
1 0 0 1 0 1
1 0 0 0 1 1
1 1 1 1 1 1
!ответ!
uses crt;
const n=6;
var i,j,k: integer;
a: array [1..6,1..6] of integer;
begin
for i:=1 to n do
begin
for j:=1 to n do
begin
if (i=j) or (j=1) or (i=1) or (i=6) or (j=6) then
a[i,j]:=1
else
a[i,j]:=0;
write(a[i,j]:3);
end;
writeln;
end;
Answers & Comments
n = 6;
var
i, j, k: integer;
a: array [1..6, 1..6] of integer;
begin
for i := 1 to n do
begin
for j := 1 to n do
begin
if (i = j) or (j = 1) or (i = 1) or (i = 6) or (j = 6) then
a[i, j] := 1
else
a[i, j] := 0;
write(a[i, j]:3);
end;
writeln();
end;
end.