Adapted by Neilor Tonin, URI Brazil
Write an algorithm to read an undeterminated number of data, each containing an individual's age. The final data, which will not enter in the calculations, contains the value of a negative age. Calculate and print the average age of this group of individuals.
The input contains an undetermined number of integers. The input will be stop when a negative value is read.
The output contains a value corresponding to the average age of individuals.
The average should be printed with two digits after the decimal point.
Input Sample | Output Sample |
34 |
39.25 |