/* 输入: * 81 4 2 2 输出: 94.73 3.41 * */ public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); List<String[]> list = new ArrayList<>(); while (sc.hasNextLine()) { String str = sc.nextLine().trim(); // 一直暂停, 我是这么解决的! if ("".equals(str)) break; String[] line = str.split(" "); list.add(line); } sc.close(); Double[] res = doTest1(list); for (Double d: res) { System.out.println(String.format("%.2f", d)); } }