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 |
Re:这么简单的问题也错,高人帮看看吧In Reply To:这么简单的问题也错,高人帮看看吧 Posted by:faen at 2005-05-12 19:06:31 > 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)); > } > > } > } > 我不会算,也不会Java,但一改就对了。好好看看吧! Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator