Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

苍天啊!什么问题呀?!

Posted by qiqilrq at 2007-01-04 19:09:14 on Problem 2365
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator