- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
uses graph, crt;
var gd,gm,i:integer;
x0,y0,x1,y1,x2,y2,x3,y3,x4,y4,x5,y5,l,r:integer;
procedure calculationx(r:integer);
begin
x1:=x0;
x2:=x0+trunc(r*sin(36*pi/180));
x3:=x0-trunc(r*cos(18*pi/180));
x4:=x0+trunc(r*cos(18*pi/180));
x5:=x0-trunc(r*sin(36*pi/180));
end;
procedure drow(x1,y1,x2,y2,x3,y3,x4,y4,x5,y5:integer);
begin
line(x1,y1,x2,y2);
line(x2,y2,x3,y3);
line(x3,y3,x4,y4);
line(x4,y4,x5,y5);
line(x5,y5,x1,y1);
end;
procedure stars(r:integer); var y1,y2,y3,y4,y5:integer;
begin
calculationx(r);
y1:=y0-r;
y2:=y0+trunc(r*cos(36*pi/180));
y3:=y0-trunc(r*sin(18*pi/180));
y4:=y0-trunc(r*sin(18*pi/180));
y5:=y0+trunc(r*cos(36*pi/180));
drow(x1,y1,x2,y2,x3,y3,x4,y4,x5,y5);
r:=trunc(r*sin(18*pi/180)/sin(126*pi/180));
calculationx(r);
y1:=y0+r;
y2:=y0-trunc(r*cos(36*pi/180));
y3:=y0+trunc(r*sin(18*pi/180));
y4:=y0+trunc(r*sin(18*pi/180));
y5:=y0-trunc(r*cos(36*pi/180));
drow(x1,y1,x2,y2,x3,y3,x4,y4,x5,y5);
if (r>0) then stars(trunc(r*sin(18*pi/180)/sin(126*pi/180)));
end;
begin
read(l);
initgraph(gd,gm,'');
x0:=getmaxx div 2;
y0:=getmaxy div 2;
r:=trunc(l/cos(18*pi/180)/2);
{circle(x0,y0,r);}
stars(r);
readkey;
end.