Screenshot_20240628_094234_Kotlin Compiler Offline...
# getting-started
s
Screenshot_20240628_094234_Kotlin Compiler Offline.jpg
e
.toInt()
m
readLine() accepts the numbers as a String so you need to cast it into an Int, you could also use (!!) to prevent null entries. var num = readLine()!!.toInt()
s
Yeh thanks, it seems readln().toInt() is the preferred way