|
|
back to boardDiscussion of Problem 1020. RopeIt accepted! Posted by Jumbo 21 Mar 2011 22:35 type t=record x,y:real; end; function dlina(x1,y1,x2,y2:real): real; begin dlina:=sqrt( (x1-x2)*(x1-x2) + (y1-y2)*(y1-y2) ); end; var n,i:integer; x,y,p,cos,r:real; mas:array[1..103] of t; Begin readln(n,r); p:=0; for i:=1 to n do begin readln(mas[i].x,mas[i].y); if i>1 then p:=p+dlina(mas[i-1].x,mas[i-1].y,mas[i].x,mas[i].y); end; p:=p+dlina(mas[1].x,mas[1].y,mas[n].x,mas[n].y); p:=p+2*3.14159*r; writeln(p:1:2); end. Re: It accepted! jajaja good! I don't know this: 2*3.14159*r saves a lot of code! jajaja Re: It accepted! 2*3.14159*r = d*Pi Re: It accepted! Posted by yutr777 27 Dec 2013 10:13 d*R - It means the length of circle |
|
|