1个回答
展开全部
import java.io.*;
public class Test{
public static double V0;
public static double t;
public static double g = 9.8;
public static void main(String args[]){
System.out.println("input v0,t");
try{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String str = "";
while((str=br.readLine())!=null){
String details[] = str.split(" ");
System.out.println(Double.parseDouble(details[0]));
double s ;
s = Double.parseDouble(details[0])*Double.parseDouble(details[1])+
0.500*g*Double.parseDouble(details[1])*Double.parseDouble(details[1]);
System.out.println(s);
}
}catch(Exception e){
e.printStackTrace();
}
}
}
你输入的数据精度越大,求出的数据精度就越大
public class Test{
public static double V0;
public static double t;
public static double g = 9.8;
public static void main(String args[]){
System.out.println("input v0,t");
try{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String str = "";
while((str=br.readLine())!=null){
String details[] = str.split(" ");
System.out.println(Double.parseDouble(details[0]));
double s ;
s = Double.parseDouble(details[0])*Double.parseDouble(details[1])+
0.500*g*Double.parseDouble(details[1])*Double.parseDouble(details[1]);
System.out.println(s);
}
}catch(Exception e){
e.printStackTrace();
}
}
}
你输入的数据精度越大,求出的数据精度就越大
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询