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 |
为什么总是Runtime Error呢?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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator