Sequence mean
Problem
Given a non-empty sequence of integers ending in zero. Zero is not included in the sequence, it serves as a sign of its end. Determine the average value of all elements of the sequence.
Input
A sequence of integers is entered, ending with the number
0
(the number
0
itself is not included in the sequence, but serves as a sign of its end).
Imprint
Print the answer to the problem.
Examples
# |
Input |
Output |
1 |
4
2
7
0 |
4.333333333333333 |
Запрещенные операторы: list
; [