public static void main(String[] args) {
int[][] arr = {{23, 45, 65, 34, 21, 67, 78},{46, 14, 18, 46, 98, 63, 88},{98, 81, 64, 90, 21, 14, 23},{54, 43, 55, 76, 22, 43, 33}};
for (int i = 0; i < arr.length; i++) {
int total=0;
for (int j = 0; j < arr[i].length; j++) {
total += arr[i][j];
}
System.out.println("第"+i+"行的和为:"+total);
}
}
记录每行的下标以及和,然后用排序算法查找其最大行