- 4
Kotlin
fun main(args: Array<String>) { var hour = readLine()!!.toInt() var taim=18 if (taim<=17) { print("Open") } else (taim<19){ print("Closed") }
4 Respuestas
+ 5
fun main(args: Array<String>) {
var hour = readLine()!!.toInt()
//var taim=18
if (hour<=18) {
print("Open")
}
else {
print("Closed")
}
0
What is this?
0
You create a program for a security system that opens / closes the door depending on the time of day. Your program needs to take the time of day as input (0 to 24) and output "Open" if it is less than or equal to 18, and "Closed" otherwise. Example Input Data: 21 Sample Output Data: Closed
0
Not