Trying to write a simple scala program that takes user inputs as ints, stores them in a tuple, then selects the max number from the tuple. I'm not sure as to why my code is not working.
import scala.io.StdIn._
println("Please enter four numbers.")
val one = readInt()
val two = readInt()
val three = readInt()
val four = readInt()
val numbers = (one, two, three, four)
println(math.max(numbers))
Error I'm getting:
C:\Users\Tyler\Documents\School\CSC10101\Mimir Assignments\max.scala:8: error: overloaded method value max with alternatives:
(x: Double,y: Double)Double <and>
(x: Float,y: Float)Float <and>
(x: Long,y: Long)Long <and>
(x: Int,y: Int)Int
cannot be applied to ((Int, Int, Int, Int))
println(math.max(numbers))
^
one error found
Any help is greatly appreciated!