We have a list of numbers of type Double, find the average of these numbers.
Fold and reduce on collections
Find the average of numbers
Report a typo
Sample Input 1:
10.0 9.5 8.0 7.5 6.0 5.5Sample Output 1:
7.75Write a program in Kotlin
fun main() {
val list = readln().split(" ").map { it.toDouble() }
// write your code here
val res =
println(res)
}
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.