錯誤的值是怎么算的
val a = List(3,5,9) a.reduceLeft((x,y)=>(x+x))? =12 ? a.reduceLeft((x,y)=>(x+y))? =17 OK a.reduceLeft((x,y)=>(x+x+y))? =31 ?
val a = List(3,5,9) a.reduceLeft((x,y)=>(x+x))? =12 ? a.reduceLeft((x,y)=>(x+y))? =17 OK a.reduceLeft((x,y)=>(x+x+y))? =31 ?
2016-07-14
舉報
2016-07-15
(3, 5) => 3+3 => 6 , ? ?(6, 9)=>6+6 => 12
(3, 5) => 3+5 => 8 , ? ?(8, 9)=>8+9 => 17
(3, 5) => 3+3+5 => 11 , ? ?(11, 9)=>11+11+9 => 31