range
Submit solution
Points:
10 (partial)
Time limit:
1.0s
Memory limit:
64M
Authors:
Problem type
Allowed languages
Java 19, Java 8
Description
輸入五個浮點數,輸出它們的平均數(全部加總/5)和全距(最大值減最小值)。
第一行輸出平均數,第二行輸出全距。
Hint
- 可以使用Math.max(a, b)以及Math.min(a, b)函式
Sample input & output
Input #1
1.5 2.5 3.5 4.5 5.5
Output #1
3.5
4.0
Input #2
-10.5 -9.5 0 9.5 11.5
Output #2
0.2
22.0
Comments