ホームページ >ウェブフロントエンド >htmlチュートリアル >HTML で階乗を実装するのはなぜ間違っているのでしょうか? 誰か助けてくれませんか?_html/css_WEB-ITnose
3d5001d4a74c4b681850f519bcffe8a9
93f0f5c25f18dab9d176bd4f6de5d30e
ebeda52af7641f7e715679a8472f8c69
b2386ffb911b14667cb8f0f91ea547a7项目36e916e0f7d1e588d4f442bf645aedb2f
9c3bca370b5104690d9ef395f2c5f8d1
46d5fe1c7617e3914f214aaf043f4ccf
.div{
background-color:#339966;
width:700px;
height:250px;
margin:0 auto;
border:20px groove #4CBE4C;
}
.STYLE1 {
color: #FFFFFF;
font-weight: bold;
font-size: 24px;
}
531ac245ce3e4fe3d50054a55f265927
6c04bd5ca3fcae76e30b72ad730ca86d
8019067d09615e43c7904885b5246f0a
function js(){
var n = document.getElementById("form1").value;
for (i=1,sum=0;ic3b49ecbaf2e93d06fb663410a2c91c7
a3fe14d0a347f917f8d6bc9312f0b62f
9dae22e5d4a88eef385285c4739a4d4a
a34de1251f0d9fe1e645927f19a896e8
5a652d793dbd2b45db211f7ca344f5b543ef61c9cd040f3a1d0165daefd0a5f4计算∑N!94b3e26ee717c64999d7867364b1b4a3b90dd5946f0946207856a8a37f441edf
fd273fcf5bcad3dfdad3c41bd81ad3e5
a34de1251f0d9fe1e645927f19a896e8
b8cffb38cc480bdba8f2983902aa17f1be36754878d1c04af1a09c763c335e2c输入整数N的值:16b28748ea4df4d9c2150843fecfba68b90dd5946f0946207856a8a37f441edf
65a0323f6988dd4e243b5cf8b0d789f477a9e60f230f7b87a2872e9a60a609d8
2e1cf0710519d5598b1f0f14c36ba674
cbb470ac000b5ab6d0e99ef979ebeacc
8c1ecd4bb896b2264e0711597d40766c
f5a47148e367a6035fd7a2faa965022e b90dd5946f0946207856a8a37f441edf
fd273fcf5bcad3dfdad3c41bd81ad3e5
a34de1251f0d9fe1e645927f19a896e8
b8cffb38cc480bdba8f2983902aa17f1be36754878d1c04af1a09c763c335e2c∑N!=16b28748ea4df4d9c2150843fecfba68b90dd5946f0946207856a8a37f441edf
65a0323f6988dd4e243b5cf8b0d789f4afb4d23410b44fd2c7adc76695c1b104
2e1cf0710519d5598b1f0f14c36ba674
6b4af2ca606318e6baf787d5ce1ae836
8c1ecd4bb896b2264e0711597d40766c
f5a47148e367a6035fd7a2faa965022e b90dd5946f0946207856a8a37f441edf
fd273fcf5bcad3dfdad3c41bd81ad3e5
a34de1251f0d9fe1e645927f19a896e8
65a0323f6988dd4e243b5cf8b0d789f4493c81f95535e8c50ad2e164bd018df0
2e1cf0710519d5598b1f0f14c36ba674
be36754878d1c04af1a09c763c335e2c
7bf647815b50935718f6875cc2d3e7b1
16b28748ea4df4d9c2150843fecfba68
8c1ecd4bb896b2264e0711597d40766c
f5a47148e367a6035fd7a2faa965022e b90dd5946f0946207856a8a37f441edf
41121ebd3f7e14f46b91bf5c35911743de391e5641fbb0e36981839808650d40
66149193c7e51d2a47dbc07047cddad0
2d20141fd3df61e23e6da7f45136680b
16b28748ea4df4d9c2150843fecfba68
8c1ecd4bb896b2264e0711597d40766c
f5a47148e367a6035fd7a2faa965022e b90dd5946f0946207856a8a37f441edf
fd273fcf5bcad3dfdad3c41bd81ad3e5
f16b1740fad44fb09bfe928bcc527e08
16b28748ea4df4d9c2150843fecfba68
36cc49f0c466276486e50c850b7e4956
73a6ac4ed44ffec12cee46588e518a5e
<html ><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title>项目3</title></head><style type="text/css">.div{background-color:#339966;width:700px;height:250px;margin:0 auto;border:20px groove #4CBE4C;}.STYLE1 {color: #FFFFFF;font-weight: bold;font-size: 24px;}</style><body><script type="text/javascript"> function js(){ var n = parseInt(document.getElementById("N").value)||0; var r=1; for (i=1;i<=n;i++){r*=i;} document.getElementById("sum").value=r }</script><div class="div"> <form id="form3" name="form3" method="post" action=""> <table width="700" border="0" align="center"> <tr> <td height="50" colspan="2"><p align="center" class="STYLE1" >计算∑N!</p></td> </tr> <tr> <td height="50" class="STYLE1"><div align="center">输入整数N的值:</div></td> <td height="50"> <label> <input type="text" name="N" id="N" /> </label> </td> </tr> <tr> <td height="50" class="STYLE1"><div align="center">∑N!=</div></td> <td height="50"> <label> <input type="text" name="sum" id="sum" /> </label> </td> </tr> <tr> <td height="50"> <label> <div align="center"> <input type="submit" name="Submit" value="计算∑N!" onClick="js();return false;"/> </div> </label></td> <td height="50"> <label> <div align="center"> <input type="reset" name="Submit2" value="清空" /> </div> </label> </td> </tr> </table> </form> </div></body></html>