Hello good night everyone, every time I fill an array in Kotlin manually I get this type of error, will you know how to solve it?
import java.lang.System.`in`
import java.util.Scanner
fun main(args: Array<String>) {
val scanner = Scanner(System.`in`)
val Teclado = Scanner(System.`in`)
var Valor=Teclado.nextInt()
print("Igrese el Tamaño del arreglo: ")
val Tamanio = scanner.nextInt()
var Silvia=IntArray(Tamanio)
for (Iteracion in 1..Tamanio){
print("Posicion[ $Iteracion ]: ")
Silvia[Iteracion]= Teclado.nextInt()
}
}
Thanks in advance