| ||||||||||
| 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 | |||||||||
c怎么结束输入啊,Output Limit Exceeded#include <stdio.h>
#include<math.h>
#define pi 3.1415926
int main()
{
float r,h,d1,A1,d2,A2,d,A;
while(scanf("%f%f%f%f%f%f",&r,&h,&d1,&A1,&d2,&A2))
{
A = A2 - A1;
if(A < 0)
A = -A;
d = sqrt(d1 * d1 + d2 * d2 - 2 * d1 * d2 * cos(A * r / sqrt(r * r + h * h) * pi / 180));
printf("%.2f\n",d);
}
return 0;
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator