package test;
import java.util.Scanner;
/**
- 录入n个班级的成绩 并求出 总分与平均分
- @author gaofuzhi
*/
public class Array_2D {
public static void main(String[] args) {
System.out.print("please input class mount:");
Scanner input = new Scanner(System.in);
int cmount = input.nextInt();
double[][] count = new double[cmount][];
for(int i=0;i<count.length;i++){
System.out.print("please input "+(i+1)+" class people mount:");
int pmount = input.nextInt();
count[i] = new double[pmount];
double sum = 0;
double average = 0;
for(int j=0;j<count[i].length;j++){
System.out.print("please input "+(j+1)+" student grade:");
sum += input.nextDouble();
average = sum/count[i].length;
}
System.out.println("summary is :"+sum);
System.out.println("average is :"+average);
}
}
}