| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
苍天啊!什么问题呀?!#include<stdio.h>
#include<math.h>
#define pi 3.141592653589793
int main()
{
double x,y,xo,yo,a,b,l=0;
int n,i,r;
scanf("%d%d",&n,&r);
scanf("%lf%lf",&xo,&yo);
x=(a=xo);
y=(b=yo);
for(i=1;i<n;i++)
{
scanf("%lf%lf",&xo,&yo);
l+=sqrt((xo-x)*(xo-x)+(yo-y)*(yo-y));
x=xo;
y=yo;
}
l+=sqrt((xo-a)*(xo-a)+(yo-b)*(yo-b));
l+=2.0*pi*(double)r;
printf("%.2lf\n",l);
return 0;
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator