javascript中运用for循环
运用javascript 中相关for循环的知识。输出1,2,3,5,8,13,21,34,55,89
<div id="show"><hr/><script> // 累加结果 function Fib3(num) { var a,b,c,i,c=num,num=num/2; for(a=b=i=1;i<num;i++) a += b,b+= a; return c%2?a:b; } var show = document.getElementById("show"); for(var i=0;i<20;i++){ show.innerHTML += Fib3( i) +","; } </script>