9.20JAVASCRIPT

循环语句,一个小例子。

<script>
蓝球弹起的高度  100米 第几次高度小于1米
var height=100;
    var count=0;
    while("ture"){
        height*=0.6;    
        count++;
        if(height<1){
            break;
        }
    }
    alert(count);

</script>

posted @ 2017-09-20 20:19  sistrong  阅读(74)  评论(0编辑  收藏  举报