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

modified

Posted by 00448264 at 2005-07-27 22:44:51
In Reply To:麻烦看一下我的为啥不过 Posted by:butterflu at 2005-07-27 22:40:36
#include<math.h>
#include<iostream.h>

const double pi= 3.14159265358979;

main()
{
	double r,h,d1,A1,d2,A2,A;
	cout.setf(ios::fixed, ios::floatfield);
	cout.precision(2);
	while(cin>>r>>h>>d1>>A1>>d2>>A2)
	{
		A=fabs(A1-A2);
		if(A>(360.0-A))
			A=360.0-A;
		A=A/360.0*2*pi*r/sqrt(r*r+h*h);
		cout<<sqrt(d1*d1+d2*d2-2.0*d2*d1*cos(A))<<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