- 绕钉子的长绳子
- 2009-02-20 18:24:27 @
var
n,r,i:integer;
a,b,c,d,l,x,y:real;
begin
read(n,r);
c:=0;d:=0;
readln(x,y);
for i:=2 to n do
begin
readln(a,b);
l:=sqrt(sqr(a-c)+sqr(b-d))+l;
c:=a;d:=b;
end;
l:=l+sqrt(sqr(a-x)+sqr(b-y))+2*r*3.1415926;
write(l:0:2);
end.
1 条评论
-
777 LV 5 @ 2009-03-15 16:41:06
for 1 to n do 吧
- 1