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

我帮你把代码整成C++的就过了,顺便帮你修改了一个bug,你忘记处理H了

Posted by czcomt at 2009-01-01 02:04:32 on Problem 2276
In Reply To:这么简单的问题也错,高人帮看看吧 Posted by:faen at 2005-05-12 19:06:31
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
	//freopen("1.txt", "r", stdin);
	double D,H,a,b,y;
	cin>>D>>H;
	while (cin>>a>>b>>y, a+b+y > 0)
	{
		a = a/180*3.1415926;
		b = b/180*3.1415926;
		y = y/180*3.1415926;
		double tanb2 = tan(b)*tan(b);
		double h = sqrt(2*D*D*tanb2/(1/tan(y)*tanb2*1/tan(y) + 1/tan(a)*tanb2*1/tan(a)-2));
		printf("%.0lf\n", H+h);
	}
	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