09_ for 练习 _ FlowerNumber

  • <!DOCTYPE html>
    <html>
        <head>
            <meta charset="utf-8" />
            <title>Flower Number.</title>
        </head>
        <body>
            <script type="text/javascript">
                var i = 100;
                var sum = 0;
                var ge;
                var shi;
                var bai;
                
                document.write("The Flower Number have <br />");
                for(i=100; i<=999; i++)
                {
                    ge = i%10;
                    shi = parseInt(i%100/10);
                    bai = parseInt(i/100);
                    if(i == (ge*ge*ge+shi*shi*shi+bai*bai*bai))
                    {
                        document.write(i+"<br />");
                    }
                }
                
            </script>
        </body>
    </html>

     

posted @ 2018-09-19 22:57  耶梦加德  阅读(143)  评论(0编辑  收藏  举报