Program p1;
var
a:array[1..7,1..7] of byte;
i,j:byte;
begin
for i:=1 to 7 do
begin
for j:=1 to 7 do
begin
if i<=4 then<br> if (j>=i) and (j<=8-i) then a[i,j]:=1 else a[i,j]:=0<br> else
if (j<=i) and (j>=8-i) then a[i,j]:=1 else a[i,j]:=0;
Write(a[i,j]:2)
end;
Writeln
end
end.
Результат выполнения программы:
1 1 1 1 1 1 1
0 1 1 1 1 1 0
0 0 1 1 1 0 0
0 0 0 1 0 0 0
0 0 1 1 1 0 0
0 1 1 1 1 1 0
1 1 1 1 1 1 1
program p2;
var
a:array[1..6,1..6] of byte;
i,j:byte;
begin
for i:=1 to 6 do
begin
for j:=1 to 6 do
begin
a[i,j]:=i+j-1;
if a[i,j]>6 then a[i,j]:=a[i,j]-6;
Write(a[i,j]:2)
end;
Writeln
end
end.
Результат выполнения программы:
1 2 3 4 5 6
2 3 4 5 6 1
3 4 5 6 1 2
4 5 6 1 2 3
5 6 1 2 3 4
6 1 2 3 4 5