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

为啥总是WA...哪位大牛帮我看看吧

Posted by T_mon at 2010-01-29 14:16:46 on Problem 3737
就是按照公式套的.....结果总是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:
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