标签:ima ++ type nal xmlns script style span w3c
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-cn"> <head> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /> <title>网页标题</title> <meta name="keywords" content="关键字列表" /> <meta name="description" content="网页描述" /> <link rel="stylesheet" type="text/css" href="" /> <style type="text/css"></style> <script type="text/javascript"> //一张纸的厚度是0.01毫米,则该纸对折30次后是多厚?反过来,一张纸对折几次后,就超过一米厚了? //定义纸的初始厚度 var houdu = 0.01/1000; //定义初始变量并把毫米转换为米 for(var i=1;i<=30;i++){ //每对折一次就翻倍 houdu *= 2; //判断几次超过一米 if(houdu>1 && houdu<2){ document.write(‘对折‘+i+‘次超过1米<br>‘); } } document.write(‘对折30次的厚度‘+houdu+‘米‘); </script> </head> <body> </body> </html>
标签:ima ++ type nal xmlns script style span w3c
原文地址:http://www.cnblogs.com/liujinrui/p/6124293.html