var n1 = 1;
var n2 = 1;
var n3;
// for循环功能 :遍历输出n1 n2 n3 的返回值
for (var i = 3; i <= n; i++) {
n3 = n1 + n2;
n1 = n2;
n2 = n3;
}
console.log(n1,n2,n3);
for循环输出n1n2 n3的值
最新推荐文章于 2023-11-17 16:52:15 发布
var n1 = 1;
var n2 = 1;
var n3;
// for循环功能 :遍历输出n1 n2 n3 的返回值
for (var i = 3; i <= n; i++) {
n3 = n1 + n2;
n1 = n2;
n2 = n3;
}
console.log(n1,n2,n3);