4.
program p3;
uses Robot;
procedure Square2;
begin
right;
paint;
down;
left;
up;
paint
end;
var i,j:integer;
Task('p3');
for i := 1 to 6 do
Square2;
if i<=5 then
for j := 1 to 2 do left;
for j := 1 to 2 do up
end
end.
5.
program p4;
up
var i:integer;
Task('p4');
for i:= 1 to 2 do right;
for i:= 1 to 2 do down;
for i:= 1 to 2 do left;
for i:= 1 to 2 do up
Объяснение:
Второй вариант 5-го задания с двумя процедурами
procedure Square;
Square
4.
program p3;
uses Robot;
procedure Square2;
begin
right;
paint;
down;
paint;
left;
paint;
up;
paint
end;
var i,j:integer;
begin
Task('p3');
for i := 1 to 6 do
begin
Square2;
if i<=5 then
begin
for j := 1 to 2 do left;
for j := 1 to 2 do up
end
end
end.
5.
program p4;
uses Robot;
procedure Square2;
begin
paint;
right;
paint;
down;
paint;
left;
paint;
up
end;
var i:integer;
begin
Task('p4');
Square2;
for i:= 1 to 2 do right;
Square2;
for i:= 1 to 2 do down;
Square2;
for i:= 1 to 2 do left;
Square2;
for i:= 1 to 2 do up
end.
Объяснение:
Второй вариант 5-го задания с двумя процедурами
program p4;
uses Robot;
procedure Square2;
begin
paint;
right;
paint;
down;
paint;
left;
paint;
up
end;
procedure Square;
var i:integer;
begin
Square2;
for i:= 1 to 2 do right;
Square2;
for i:= 1 to 2 do down;
Square2;
for i:= 1 to 2 do left;
Square2;
for i:= 1 to 2 do up
end;
begin
Task('p4');
Square
end.