| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
modifiedIn 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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator