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 ericsummer at 2005-08-05 18:50:29 on Problem 2508
#include <iostream.h>
#include <math.h>
#include <iomanip.h>


double min(double x ,double y)
{
	return x<y?x : y ;
}

int main()
{

	double r , h , d1 , a1 , d2 , a2 ,x ,d;

	double pi = 2.0* asin(1);

	while(cin >> r >> h >> d1 >> a1 >> d2 >> a2) 
	{

	x = r*fabs(a1 - a2)/sqrt( r*r + h*h) * pi/180.0;

	x = min(x , 2*pi*r/sqrt( r*r + h*h) -x);

	d = sqrt( d1*d1+ d2*d2 - 2*d1*d2*cos(x));

	
	

	cout<< fixed << setpricision(2) << endl;

	}

	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