import scala.math.BigInt
val fibo: Stream[BigInt] =
BigInt(0) #:: BigInt(1) #:: fibo.zip(fibo.tail).map(n=>n._1+n._2)
import scala.math.BigInt
val fibo: Stream[BigInt] =
BigInt(0) #:: BigInt(1) #:: fibo.zip(fibo.tail).map(n=>n._1+n._2)
本文标题:scala 生成斐波那契数列Feibonacci Seq
本文链接:https://www.haomeiwen.com/subject/fsjugxtx.html
网友评论