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 |
这么简单的问题也错,高人帮看看吧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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator