Home > Web Front-end > HTML Tutorial > Why is it wrong to implement factorial in html? Can anyone help me? _html/css_WEB-ITnose

Why is it wrong to implement factorial in html? Can anyone help me? _html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:53:25
Original
1499 people have browsed it




项目3





 
  
    
      
    
    
      
      
    
    
      
      
    
    
      
      
        
            
    

  

计算∑N!

输入整数N的值:

        
      
      
∑N!=

        
      
      

        
      
      





回复讨论(解决方案)

<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" >计算&#8721;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">&#8721;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>
Copy after login

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template