| ||||||||||
| 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 | |||||||||
为什么WA啊?求测试数据!#include <iostream>
#include <math.h>
#include <conio.h>
using namespace std;
int main()
{
freopen("2508.in","r",stdin);
double r,h;
double d1,A1,d2,A2;
double R;
double A;
double dis;
while(cin>>r>>h>>d1>>A1>>d2>>A2)
{
R=sqrt(r*r+h*h);
A=(A1-A2);
if(A>180)A-=180;
A=A*r/R;
if(A<0)A=A*(-1);
dis=sqrt(d1*d1+d2*d2-2*d1*d2*cos(A/360*3.14159265897*2));
printf("%.2f\n",dis);
}
getch();
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator