Write a program that reads a color name and prints the position of this color in the rainbow, starting with 1.
Computer scienceProgramming languagesKotlinObject-oriented programmingObject-oriented programming usage
Enum
The rainbow order
Report a typo
Sample Input 1:
redSample Output 1:
1Sample Input 2:
orangeSample Output 2:
2Write a program in Kotlin
fun main() {
val color = readln()
// put 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.