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 497597816 at 2007-05-30 22:48:52 on Problem 2365
#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:
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