2.24

来源:互联网 发布:xcode使用教程c语言 编辑:程序博客网 时间:2024/05/21 11:03
import java.text.DecimalFormat;import java.util.Scanner;public class Hello{/** * @param args */public static void main(String[] args){// TODO Auto-generated method stubdouble v,a,c;Scanner in=new Scanner(System.in);System.out.print("Enter v and a:  ");v=in.nextDouble();a=in.nextDouble();c=(v*v)/(2*a);DecimalFormat d = new DecimalFormat("0.000");System.out.println("The minimum runway length for this airplane is "+d.format(c));}}

0 0
原创粉丝点击