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

我知道了,是4。54, 刚才2*pi-a也改了---但还wa :。(,高手们再看看。。

Posted by fjnu_jxd_010 at 2005-07-28 15:57:52 on Problem 2508
In Reply To:2*pi*r*1/4=4.71,,,那4.54是怎么算的 ? Posted by:fjnu_jxd_010 at 2005-07-28 15:51:16
#include<iostream>
#include<iomanip>
#include<cmath>
using namespace std;
int main()
{
double  r, h, d1, a1,d2,a2,pi=3.1415926535898,R,w,ld,sha,dm,da,h1,slo,a;//
	while(cin>>r>>h>>d1>>a1>>d2>>a2)
	{	if(fabs(a1-a2)==0||fabs(a1-a2)==360)
slo=fabs(d1-d2);
	else
	{

	a1=a1/360.0*2.0*pi;
		a2=a2/360.0*2*pi;
		R=sqrt(r*r+h*h);
		a=fabs(a1-a2);
	
	//	else 
	//	{
			if(d1>d2)
			{	da=d1;dm=d2;}

			else
			{da=d2;dm=d1;}

	  
		if(a>pi)
			a=2*pi-a;
		w=2.0*pi*r/R*a/(2*pi);
		sha=sin(w)*d1*d2;
		h1=sha/da;
		ld=sqrt(dm*dm-h1*h1);
		slo=sqrt(h1*h1+(da-ld)*(da-ld));
	}
		cout<<fixed<<setprecision(2)<<slo<<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