a1
program a1;
uses graphABC;
var i:integer;
begin
SetWindowSize(400,400);
for i:=0 to 7 do
line(0,50*i,50*i,0);
line(400,50*i,50*i,400)
end
end.
b1
program b1;
line(50*i,0,400,400-50*i);
if i <> 0 then line(0,50*i,400-50*i,400)
a2
program a2;
line(400,50*i,50*i,400);
b2
program b2;
for i:=1 to 7 do line(50*i,0,50*i,400);
for i:=1 to 7 do line(0,50*i,400,50*i)
Объяснение:
используем циклы с параметром
a1
program a1;
uses graphABC;
var i:integer;
begin
SetWindowSize(400,400);
for i:=0 to 7 do
begin
line(0,50*i,50*i,0);
line(400,50*i,50*i,400)
end
end.
b1
program b1;
uses graphABC;
var i:integer;
begin
SetWindowSize(400,400);
for i:=0 to 7 do
begin
line(50*i,0,400,400-50*i);
if i <> 0 then line(0,50*i,400-50*i,400)
end
end.
a2
program a2;
uses graphABC;
var i:integer;
begin
SetWindowSize(400,400);
for i:=0 to 7 do
begin
line(0,50*i,50*i,0);
line(400,50*i,50*i,400);
line(50*i,0,400,400-50*i);
if i <> 0 then line(0,50*i,400-50*i,400)
end
end.
b2
program b2;
uses graphABC;
var i:integer;
begin
SetWindowSize(400,400);
for i:=1 to 7 do line(50*i,0,50*i,400);
for i:=1 to 7 do line(0,50*i,400,50*i)
end.
Объяснение:
используем циклы с параметром