日期:2014-05-17 浏览次数:21060 次
<form name = "form1" method ="post" action ="">
<p>请输入求和范围 </p>
下限<input name ="tlow" type= "text" id ="tlow" size ="10" onkeypress="this.value=this.value.replace(/[^\d]/g,'')" />
上限<input name ="thigh" type ="text" id ="thigh" size ="10" onkeypress="this.value=this.value.replace(/[^\d]/g,'')" />
<input type ="submit" value ="求和">
</form>
<%
dim tlow,thigh,n,i
tlow=request.form("tlow")
thigh=request.form("thigh")
if tlow<>"" and thigh<>"" then
if tlow>thigh then
Response.write "不能这样的"
else
n=0
for i=tlow to thigh
n=n+i
next
Response.write tlow&"累加"&thigh&"="&n
end if
end if
%>
------解决方案--------------------
揪心,你不是都写出来了么
------解决方案--------------------
呵呵,楼主太没自信了吧,你不是都写好了嘛,只是没加上判断而已,只要再耐心往下想一下应该就完美了。