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

为什么总是Runtime Error呢?

Posted by 2004374521 at 2006-08-13 21:59:06 on Problem 1045
import java.util.Scanner;
import java.text.DecimalFormat;
public class Main{
	public static void main(String[] args){
		Scanner cin=new Scanner(System.in);
		double Vs=cin.nextDouble(),r=cin.nextDouble(),c=cin.nextDouble();
		int n=cin.nextInt();
		double w,Vr;
		DecimalFormat threeDigits=new DecimalFormat("0.000");
		for(int i=0;i<n;i++){
			cin=new Scanner(System.in);
		    w=cin.nextDouble();
		    Vr=Vs/Math.sqrt(r*r+1.0/(w*w*c*c))*r;
		    System.out.println(threeDigits.format(Vr));
			}
		}
	}

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