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 |
为啥总是WA...哪位大牛帮我看看吧就是按照公式套的.....结果总是wa import java.util.*; import java.text.*; import java.math.*; public class Main{ public static void main(String[] args){ DecimalFormat dft = new DecimalFormat(); dft.setMinimumFractionDigits(2); dft.setMaximumFractionDigits(2); dft.setRoundingMode(RoundingMode.HALF_UP); Scanner in = new Scanner(System.in); double s; double pi = Math.acos(-1.0); while(in.hasNext()){ s = in.nextDouble(); double h,r,v; h = Math.sqrt(2*s/pi); r = Math.sqrt(s/4/pi); v = Math.sqrt((s *s * s)/(72 * pi)); System.out.println(dft.format(v)); System.out.println(dft.format(h)); System.out.println(dft.format(r)); } } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator