下面展示代码:
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
double x=sc.nextInt(),y=sc.nextInt(),z=sc.nextInt();
double x1=sc.nextInt(),y1=sc.nextInt(),z1=sc.nextInt();
int v=sc.nextInt();
double time;
time=x1/x+y1/y+z1/z;
System.out.println(String.format("%."+v+"f", time));
}
}
这是评测结果: