List Average
A school prints an average mark for every class in the parents' evening handout. The marks come off the marking sheet as one row of whole numbers, and a row can be long or very short depending on the class. The handout is typeset to a fixed width, so an average is always shown with two decimal places even when it does not need them — a class averaging exactly 7 appears as 7.00.
Task: Print the average mark for the class.
Input
A single line holding between 1 and 500 integers separated by single spaces. Each is one pupil's mark. The line always holds at least one mark.
Output
One line holding the class average with exactly two digits after the decimal point — 2.50, never 2.5 and never 2.
Example:
Input:
1 2 3 4
Output:
2.50
Sign in to solve this problem
Reading problems is free for everyone — solving them (Run, Submit, and tracking what you've solved) needs an account.
Sign in