Min Max Sum Average
Write a program that reads from the console a sequence of N real numbers and returns the minimal, the maximal number, the sum and the average of all numbers (displayed with 2 digits after the decimal point).
- The input starts by the number N (alone in a line) followed by N lines, each holding an real number.
- The output is like in the examples below.
- On the first line, you will receive the number N.
- On each of the next N lines, you will receive a single real number.
- You output must always consist of exactly 4 lines - the minimal element on the first line, the maximal on the second, the sum on the third and the average on the fourth, in the following format:
min=3.00 max=6.00 sum=9.00 avg=4.50
- 1 <= N <= 1000
- All numbers will be valid integer numbers that will be in the range
- Time limit: 0.1s
- Memory limit: 16MB
- Submit your code here