//斐波那契数列:后一个数等于前面两个数的和
//0,1,1,2,3,5,8,13,21....
let readline = require("readline-sync");
console.log("请输入斐波那契数列的位数:")
let pos = readline.question("");
let num1 = 0;//第1位
let num2 = 1;//第2位
let temp = 0;//临时变量
for(let i=3;i<=pos;i++)
{
temp = num2;
num2 = num1 + num2;
num1 = temp;
}
console.log("该位数上的斐波那契数为:",num2);