Please help to bring the phrase "Hello, World!" strictly centered on the screen, in the ring of stars (the program below displays a ring of stars).
1
uses graph;
{рисование 1 звезды}
procedure Zvezda(x,y:integer);
var i:integer;
u:real;
p:array[1..11] of pointtype;
begin
u:=-pi/10;
for i:=1 to 10 do
begin
if i mod 2=0 then
begin
p[i].x:=x+round(10*cos(u));
p[i].y:=y-round(10*sin(u));
end
else
begin
p[i].x:=x+round(5*cos(u));
p[i].y:=y-round(5*sin(u));
end;
u:=u+pi/5;
end;
p[11]:=p[1];
setcolor(12);
setfillstyle(1,12);
fillpoly(11,p);
end;
var xc,yc,i,x,y:integer;
u:real;
begin
initgraph(x,y,'');
xc:=getmaxX div 2;
yc:=getmaxY div 2;
u:=0;
for i:=0 to 11 do
begin
x:=xc+round(40*cos(u));
y:=yc-round(40*sin(u));
Zvezda(x,y);
u:=u+pi/6
end;
readln
end.

New Topic/Question
Reply




MultiQuote




|