教学用[阶乘及阶乘之和]
发表于:2007-06-30来源:作者:点击数:
标签:
html head title阶乘输出/title meta http-equiv=Content-Type content=text/html; charset=gb2312 /head body bgcolor=#FFFFFF div align=centerfont color=#FF0000b阶乘输出 /b/fontb/b /div % if Request.Form(cal)=y then n=Cint(Request.form(me)) fac=1
<html>
<head>
<title>阶乘输出</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body bgcolor="#FFFFFF">
<div align="center"><font color="#FF0000"><b>阶乘输出 </b></font><b></b> </div>
<%
if Request.Form("cal")="y" then
n=Cint(Request.form("me"))
fac=1
S=0
For i=1 to n
fac=fac*i
S=S+fac
Next
Response.Write n & "!=" & fac & "<br>"
Response.Write n&"!的阶乘之和为:" & S
end if
%>
<form method="post" action="try1.asp">
输入数字:
<input type="text" name="me" size="5">
<input type=hidden name=cal value=y>
<input type="submit" name="Submit" value="提交">
</form>
</body>
</html>
原文转自:http://www.ltesting.net