0
I need to read three variables in the same line in Scala, I read an answer in English but the method did not work, "readline" and "toInt" are not recognized. Follow my code. If anyone knows a way that works.
object main {
def main(args: Array[String]): Unit = {
val Array(cd1,nr1,vr1) = readLine.split(" ").map(_.toInt)
val Array(cd2,nr2,vr2) = readLine.split(" ").map(_.toInt)
val total : Double = nr1*vr1 + nr2+vr2
println(f"VALOR A PAGAR = $total%.2f")
}
}