// 用二维数组表示的学生成绩: int[][] scores = { { 82, 90, 91 }, { 68, 72, 64 }, { 95, 91, 89 }, { 67, 52, 60 }, { 79, 81, 85 }, }; double total = 0; int count=0; for (int[] arr : scores) { for (int n : arr) { total += n; count++; } } double average=total/count;
Sign in to make a reply
全力以赴的阿灿