public class Main { static long[][] data = new long[30][30]; public static void main(String[] args) { Scanner sc = new Scanner(System.in); long factor = 1;/// 计量单位的数因子 for (int i = 0; i < 30; i++) { factor <<= 1; } for (int i = 0; i < 29; ++i)// 输入数据放入二维数组(前29) { for (int j = 0; j <= i; ++j) { long a = sc.nextLong(); data[i][j] = a * factor; } } for (int i = 0; i < 29; ++i) { for (int j = 0; j <= i; ++j) { long half = data[i][j] / 2; data[i + 1][j] += half; data[i + 1][j + 1] += half; } } Arrays.sort(data[29]); System.out.println(data[29][0]); System.out.println(data[29][29]); System.out.println(data[29][29] / (data[29][0] / 2086458231)); } }