#C13647. Calculate Student Averages
Calculate Student Averages
Calculate Student Averages
Given a list of student records, your task is to compute the average score for each student across all subjects. The average is calculated using the formula:
$$average = \frac{\sum_{i=1}^{n}{score_i}}{n}$$
where \(n\) is the number of subjects for the student and \(score_i\) are the individual scores. The computed average must be rounded to two decimal places and appended at the end of each student's record.
Input is read from standard input and output should be printed to standard output.
inputFormat
The first line contains an integer n, representing the number of students. Each of the following n lines contains a student record. Each record starts with the student's name (a string) followed by one or more subject scores (numbers) separated by spaces.
outputFormat
For each student, output the original record appended with the computed average score, rounded to two decimal places. Each student's record should be printed on a new line.## sample
3
Alice 90 85 88
Bob 75 80 78
Charlie 95 92 90
Alice 90 85 88 87.67
Bob 75 80 78 77.67
Charlie 95 92 90 92.33
</p>