You have a list of grades of students in your class. Please print the grades following the LIFO strategy. For example, if you have 5, 7.5, 9.9, you must obtain: 9.9, 7.5, 5.
Stack
List of students' grades
Report a typo
Sample Input 1:
5.5 4.6 3.0 2.5 10.0 9.9 8.75Sample Output 1:
8.75 9.9 10.0 2.5 3.0 4.6 5.5Write a program in Kotlin
import java.util.*
fun main() {
val list = readln().split(" ").map{ it.toDouble() }
// write your code here
}
___
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.