#C3232. Calculate Average Scores
Calculate Average Scores
Calculate Average Scores
You are given several lines of input via stdin, where each line represents a student record. Each record consists of a student's name followed by three comma-separated scores for Math, Science, and English. Your task is to compute the average score for each student using the formula:
\(\text{Average} = \frac{\text{sum of scores}}{n}\)
The average should be rounded to the nearest integer. Then, output each student's name followed by their average score to stdout. Ensure that your program reads input from standard input and writes the results to standard output. Each student's result should be printed on a separate line.
inputFormat
The input is given via stdin as multiple lines. Each line contains a student record in the following format:
Name,Score1,Score2,Score3
There is no specific number of records; read until the end of input.
outputFormat
For each input line, output a line containing the student's name and their computed average score (rounded to the nearest integer), separated by a space.
## sampleAlice,85,90,78
Alice 84
</p>