首页 > 其他 > 详细

08_ for 练习 _ sumOf7

时间:2018-09-19 23:20:03      阅读:190      评论:0      收藏:0      [点我收藏+]
  • <!DOCTYPE html>
    <html>
        <head>
            <meta charset="utf-8" />
            <title>Sum of Odd/Even</title>
        </head>
        <body>
            <script type="text/javascript">
                var sumSeven = 0;
                var count = 0;
                var i;
                
                for(i=1; i<=100; i++)
                {
                    if(i%7 == 0)
                    {
                        sumSeven += i;
                        count++;
                    }
                }
                document.write("The sum of seven during 1~100 is "+sumSeven+"<br />");
                document.write("Count "+count+"<br />");
            </script>
        </body>
    </html>

     

08_ for 练习 _ sumOf7

原文:https://www.cnblogs.com/tianxiaxuange/p/9678170.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!