日期:2014-05-16 浏览次数:20508 次
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>new document</title> </head> <body> <script type="text/javascript"> function sqrt(n){ var x = 1; for(var i = 0; i < 10; i++){ x = (x + n / x) / 2; } return x; } for(var i = 2; i <= 100; i++){ document.write(sqrt(i) + "<br/>"); } </script> </body> </html>