学习笔记11.6

今天进行了for循环语句的复习,并对for循环语句进行了实例练习,并进行了数组的学习。

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>无标题文档</title>
    </head>
    
    <body>
        <script>
        var a=0.0001;
        var b=0;
        for(var i=1;i>0;i++)
            {
                a=a*2;
                b++;
                if(a>8848)
                    {
                        alert(b);
                        break;
                    }
            }
        
        </script>
    </body>
</html>











<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>

<body>
<script>
    var x=1;
    var y=0;
    var z=0;
    
    var nowx=0;
    var nowy=0;
    var nowz=0;
    
    for(var i=8;i>0;i--)
    {
        nowx=y+z;
        nowy=x;
        nowz=z+y;
        
        x=nowx;
        y=nowy;
        z=nowz;
    }
    alert(nowx+"   "+nowy+"   "+nowz);
    </script>

</body>
</html>
原文地址:https://www.cnblogs.com/l123789/p/6039110.html