📜  斐波那契系列 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:24.901000             🧑  作者: Mango

代码示例5
// FIBONACCI SERIES
// 0 1 1 2 3 5 8 13 

let number = 7;
// let a=0,b =1,next;
let a=-1,b=1,next;

for(let i=1;i<=number;i++){
  next= a + b;
  a = b;
  b = next
  console.log(next)
}