码迷,mamicode.com
首页 > 其他好文 > 详细

08_ for 练习 _ sumOf7

时间:2018-09-19 23:36:26      阅读:215      评论:0      收藏:0      [点我收藏+]

标签:uri   The   rip   span   utf-8   eve   ++   ack   doc   

  • <!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

标签:uri   The   rip   span   utf-8   eve   ++   ack   doc   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!