import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;
public class P49 {
public static void main(String[] args) throws IOException {
// TODO Auto-generated method stub
Scanner in = new Scanner(System.in);
System.out.println("请依次输入学生号,姓名,三门课成绩,用逗号隔开,每个学生之间用句号隔开");
String str = in.next();
String[] student = str.split("\\.");
for(int i=0;i<student.length;i++)
{
System.out.print(student[i]+" ");
}
BufferedWriter bw = new BufferedWriter(new FileWriter("F:\\stud.txt"));
for (int i = 0; i < student.length; i++)
{
String[] scores = student[i].split("\\,");
bw.write(student[i]);
int[] num1 = new int[3];
int sum = 0;
for (int m = 0; m < 3; m++)
{
num1[m] = Integer.parseInt(scores[m + 2]);
sum += num1[m];
}
bw.write(".平均分:" + sum/3);
System.out.println(sum/3);
}
bw.flush();
in.close();
}
}