object Test16 {
def main(args: Array[String]): Unit = {
vaL arr = Array (100, 20, 300, 4)
var rs = arr. reduce((x, y)= if(x>y) x else y)
printin(rs)
如图所示
object Test16 {
def main(args: Array[String]): Unit = {
vaL arr = Array (100, 20, 300, 4)
var rs = arr. reduce((x, y)= if(x>y) x else y)
printin(rs)
如图所示