| ||||||||||
| 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"
int main()
{
int i;
double a,b,r,x,y,nx,ny,len;
scanf("%d %lf",&i,&r);
if(i>0)
scanf("%lf %lf",&a,&b);
x=a;
y=b;
len=0.0;
while(i>1){
scanf("%lf %lf",&nx,&ny);
x-=nx;
y-=ny;
len=sqrt(x*x+y*y);
x=nx;
y=ny;
i--;
}
if(i>0)
len+=2*3.1415926535897932384626*r;
printf("%.2f\n",len);
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator