最新回答 / iwalkishow
1. 調(diào)用高階函數(shù),這個高階函數(shù)返回另一個函數(shù)。def a = greeting();2. 調(diào)用高階函數(shù)返回的函數(shù)。a("Jack");
2016-07-21
最贊回答 / 嘿喂狗_
(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
2016-07-14
講得很好,很細(xì), 我剛才聽了幾次.reduceLef 比foldLeft更通用的理由,后面應(yīng)該是foldleft,被講成reduceLeft了...
2016-07-13
@annotation.tailrec
def factorial(n: Int, m: Int): Int = {
println("n:=" +n)
if (n <= 0) m
else
println("m:"+m)
factorial(n - 1, m * n)
//println(m)
}
factorial(5,1)
我運(yùn)行 的時候 ,感覺進(jìn)入死循環(huán)了, n一直有很多值,
def factorial(n: Int, m: Int): Int = {
println("n:=" +n)
if (n <= 0) m
else
println("m:"+m)
factorial(n - 1, m * n)
//println(m)
}
factorial(5,1)
我運(yùn)行 的時候 ,感覺進(jìn)入死循環(huán)了, n一直有很多值,
2016-07-12
評論寫出來根本沒官方人員來閱讀,樓上朋友那么早提出來,到現(xiàn)在 20160712都還沒解決,...上一節(jié)課也是出現(xiàn)白板的情況,
2016-07-12