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

这么简单的问题也错,高人帮看看吧

Posted by faen at 2005-05-12 19:06:31 on Problem 2276
import java.io.*;
import java.util.*;
public class Main
{
	public static void main(String [] args)throws Exception
	{
		
		Scanner cin=new Scanner(System.in);
		double D=cin.nextDouble();
		double H=cin.nextDouble();
		while(true)
		{
			double a=cin.nextDouble()/180*Math.PI;
			double b=cin.nextDouble()/180*Math.PI;
			double y=cin.nextDouble()/180*Math.PI;
			if(a+b+y==0)break;
			if(a==0||b==0||y==0)
			{
				System.out.println(0);
				continue;
			}
			double tanb2=Math.tan(b)*Math.tan(b);
			double h=Math.sqrt(2*D*D*tanb2/(1/Math.tan(y)*tanb2*1/Math.tan(y)+1/Math.tan(a)*tanb2*1/Math.tan(a)-2));
			System.out.println(Math.round(h+4));
		}

	}
}


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