Friday, February 1, 2019

URI 1154:: SOLUTION

URI Online Judge | 1154

Ages

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.

Input

The input contains an undetermined number of integers. The input will be stop when a negative value is read.

Output

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 SampleOutput Sample
34
56
44
23
-2
39.25



[WAIT]
     First of all, think yourself that you have tried enough for the problem. If you did not please read the program once. REMEMBER one thing, just believe in yourself.....YOU CAN.....YOU KNOW....


See the ANSWER here...
                                                                 

No comments:

Post a Comment