同时传参,虽然比较繁琐,还是能用的。求简化
<%@language=vbscript%><!--#include file="conn.asp"-->
<%
set rs=server.CreateObject("adodb.recordset")
sql="select * from zhizgy"
rs.open sql,conn,1,3
dim nMax,nMin,a,b,c,n,n1,n2,s,i
gdangw=request("gdangw1") '写入1档
a=request("gya01")
b=request("gyb01")
c=request("gyc01")
nMax=a
nMin=a
if (a>b) and (b>c)then
nMax=a
nMin=c
end if
if (a>c) and (c>b)then
nMax=a
nMin=b
end if
if (b>a) and (a>c)then
nMax=b
nMin=c
end if
if (b>c) and (c>a)then
nMax=b
nMin=a
end if
if (c>a) and (a>b)then
nMax=c
nMin=b
end if
if (c>b) and (b>a)then
nMax=c
nMin=a
end if
if (a=b) and (a>c)then
nMax=a'也等于b
nMin=c
end if
if (a=b) and (a<c)then
nMax=c
nMin=a
end if
if (b=c) and (b>a)then
nMax=b'也等于c
nMin=a
end if
if (b=c) and (b<a)then
nMax=a
nMin=b
end if
if (c=a) and (c>b)then
nMax=c'也等于a
nMin=b
end if
if (c=a) and (c<b)then
nMax=b
nMin=c
end if
if (a=b) and (b=c)then
s=0
end if
s=((nMax-nMin)/nMin)
rs.addnew
rs("gya0")=a
rs("gyb0")=b
rs("gyc0")=c
rs("gwuc")=s
rs("gdangw")=gdangw
rs.update
rs.movenext
gdangw=request("gdangw2") '写入2档
a=request("gya02")
b=request("gyb02")
c=request("gyc02")
nMax=a
nMin=a
if (a>b) and (b>c)then
nMax=a
nMin=c
end if
if (a>c) and (c>b)then
nMax=a
nMin=b
end if
if (b>a) and (a>c)then
nMax=b
nMin=c
end if
if (b>c) and (c>a)then
nMax=b
nMin=a
end if
if (c>a) and (a>b)then
nMax=c
nMin=b
end if
if (c>b) and (b>a)then
nMax=c
nMin=a
end if
if (a=b) and (a>c)then
nMax=a'也等于b
nMin=c
end if
if (a=b) and (a<c)then
nMax=c
nMin=a
end if
if (b=c) and (b>a)then
nMax=b'也等于c
nMin=a
end if
if (b=c) and (b<a)then
nMax=a
nMin=b
end if
if (c=a) and (c>b)then
nMax=c'也等于a
nMin=b
end if
if (c=a) and (c<b)then
nMax=b
nMin=c
end if
if (a=b) and (b=c)then
s=0
end if
s=((nMax-nMin)/nMin)
rs.addnew
rs("gya0")=a
rs("gyb0")=b
rs("gyc0")=c
rs("gwuc")=s
rs("gdangw")=gdangw
rs.update
rs.movenext
gdangw=request("gdangw3") '写入3档
a=request("gya03")
b=request("gyb03")
c=request("gyc03")
nMax=a
nMin=a
if (a>b) and (b>c)then
nMax=a
nMin=c
end if
if (a>c) and (c>b)then
nMax=a
nMin=b
end if
if (b>a) and (a>c)then
nMax=b
nMin=c
end if
if (b>c) and (c>a)then
nMax=b
nMin=a
end if
if (c>a) and (a>b)then
nMax=c
nMin=b
end if
if (c>b) and (b>a)then
nMax=c
nMin=a
end if
if (a=b) and (a>c)then
nMax=a'也等于b
nMin=c
end if
if (a=b) and (a<c)then
nMax=c
nMin=a
end if
if (b=c) and (b>a)then
nMax=b'也等于c
nMin=a
end if
if (b=c) and (b<a)then
nMax=a
nMin=b
end if
if (c=a) and (c>b)then
nMax=c'也等于a
nMin=b
end if
if (c=a) and (c<b)then
nMax=b
nMin=c
end if
if (a=b) and (b=c)then
s=0
end if
s=((nMax-nMin)/nMin)
rs.addnew
rs("gya0")=a
rs("gyb0")=b
rs("gyc0")=c
rs("gwuc")=s
rs("gdangw")=gdangw
rs.update
rs.movenext
gdangw=request("gdangw4") '写入4档
a=request("gya04")
b=request("gyb04")
c=request("gyc04")
nMax=a
nMin=a
if (a>b) and (b>c)then
nMax=a
nMin=c
end if
if (a>c) and (c>b)then
nMax=a
nMin=b
end if
if (b>a) and (a>c)then
nMax=b
nMin=c
end if
if (b>c) and (c>a)then
nMax=b
nMin=a
end if
if (c>a) and (a>b)then
nMax=c
nMin=b
end if
if (c>b) and (b>a)then
nMax=c
nMin=a
end if
if (a=b) and (a>c)then
nMax=a'也等于b
nMin=c
end if
if (a=b) and (a<c)then
nMax=c
nMin=a
end if
if (b=c) and (b>a)then
nMax=b'也等于c
nMin=a
end if
if (b=c) and (b<a)then
nMax=a
nMin=b
end if
if (c=a) and (c>b)then
nMax=c'也等于a
nMin=b
end if
if (c=a) and (c<b)then
nMax=b
nMin=c
end if
if (a=b) and (b=c)then
s=0
end if
s=((nMax-nMin)/nMin)
rs.addnew
rs("gya0")=a
rs("gyb0")=b
rs("gyc0")=c
rs("gwuc")=s
rs("gdangw")=gdangw
rs.update
rs.movenext
gdangw=request("gdangw5") '写入5档
a=request("gya05")
b=request("gyb05")
c=request("gyc05")
nMax=a
nMin=a
if (a>b) and (b>c)then
nMax=a
nMin=c
end if
if (a>c) and (c>b)then
nMax=a
nMin=b
end if
if (b>a) and (a>c)then
nMax=b
nMin=c
end if
if (b>c) and (c>a)then
nMax=b
nMin=a
end if
if (c>a) and (a>b)then
nMax=c
nMin=b
end if
if (c>b) and (b>a)then
nMax=c
nMin=a
end if
if (a=b) and (a>c)then
nMax=a'也等于b
nMin=c
end if
if (a=b) and (a<c)then
nMax=c
nMin=a
end if
if (b=c) and (b>a)then
nMax=b'也等于c
nMin=a
end if
if (b=c) and (b<a)then
nMax=a
nMin=b
end if
if (c=a) and (c>b)then
nMax=c'也等于a
nMin=b
end if
if (c=a) and (c<b)then
nMax=b
nMin=c
end if
if (a=b) and (b=c)then
s=0
end if
s=((nMax-nMin)/nMin)
rs.addnew
rs("gya0")=a
rs("gyb0")=b
rs("gyc0")=c
rs("gwuc")=s
rs("gdangw")=gdangw
rs.update
rs.movenext
gdangw=request("gdangw6") '写入6档
a=request("gya06")
b=request("gyb06")
c=request("gyc06")
nMax=a
nMin=a
if (a>b) and (b>c)then
nMax=a
nMin=c
end if
if (a>c) and (c>b)then
nMax=a
nMin=b
end if
if (b>a) and (a>c)then
nMax=b
nMin=c
end if
if (b>c) and (c>a)then
nMax=b
nMin=a
end if
if (c>a) and (a>b)then
nMax=c
nMin=b
end if
if (c>b) and (b>a)then
nMax=c
nMin=a
end if
if (a=b) and (a>c)then
nMax=a'也等于b
nMin=c
end if
if (a=b) and (a<c)then
nMax=c
nMin=a
end if
if (b=c) and (b>a)then
nMax=b'也等于c
nMin=a
end if
if (b=c) and (b<a)then
nMax=a
nMin=b
end if
if (c=a) and (c>b)then
nMax=c'也等于a
nMin=b
end if
if (c=a) and (c<b)then
nMax=b
nMin=c
end if
if (a=b) and (b=c)then
s=0
end if
s=((nMax-nMin)/nMin)
rs.addnew
rs("gya0")=a
rs("gyb0")=b
rs("gyc0")=c
rs("gwuc")=s
rs("gdangw")=gdangw
rs.update
rs.movenext
gdangw=request("gdangw7") '写入7档
a=request("gya07")
b=request("gyb07")
c=request("gyc07")
nMax=a
nMin=a
if (a>b) and (b>c)then
nMax=a
nMin=c
end if
if (a>c) and (c>b)then
nMax=a
nMin=b
end if
if (b>a) and (a>c)then
nMax=b
nMin=c
end if
if (b>c) and (c>a)then
nMax=b
nMin=a
end if
if (c>a) and (a>b)then
nMax=c
nMin=b
end if
if (c>b) and (b>a)then
nMax=c
nMin=a
end if
if (a=b) and (a>c)then
nMax=a'也等于b
nMin=c
end if
if (a=b) and (a<c)then
nMax=c
nMin=a
end if
if (b=c) and (b>a)then
nMax=b'也等于c
nMin=a
end if
if (b=c) and (b<a)then
nMax=a
nMin=b
end if
if (c=a) and (c>b)then
nMax=c'也等于a
nMin=b
end if
if (c=a) and (c<b)then
nMax=b
nMin=c
end if
if (a=b) and (b=c)then
s=0
end if
s=((nMax-nMin)/nMin)
rs.addnew
rs("gya0")=a
rs("gyb0")=b
rs("gyc0")=c
rs("gwuc")=s
rs("gdangw")=gdangw
rs.update
rs.movenext
gdangw=request("gdangw8") '写入8档
a=request("gya08")
b=request("gyb08")
c=request("gyc08")
nMax=a
nMin=a
if (a>b) and (b>c)then
nMax=a
nMin=c
end if
if (a>c) and (c>b)then
nMax=a
nMin=b
end if
if (b>a) and (a>c)then
nMax=b
nMin=c
end if
if (b>c) and (c>a)then
nMax=b
nMin=a
end if
if (c>a) and (a>b)then
nMax=c
nMin=b
end if
if (c>b) and (b>a)then
nMax=c
nMin=a
end if
if (a=b) and (a>c)then
nMax=a'也等于b
nMin=c
end if
if (a=b) and (a<c)then
nMax=c
nMin=a
end if
if (b=c) and (b>a)then
nMax=b'也等于c
nMin=a
end if
if (b=c) and (b<a)then
nMax=a
nMin=b
end if
if (c=a) and (c>b)then
nMax=c'也等于a
nMin=b
end if
if (c=a) and (c<b)then
nMax=b
nMin=c
end if
if (a=b) and (b=c)then
s=0
end if
s=((nMax-nMin)/nMin)
rs.addnew
rs("gya0")=a
rs("gyb0")=b
rs("gyc0")=c
rs("gwuc")=s
rs("gdangw")=gdangw
rs.update
rs.movenext
gdangw=request("gdangw9") '写入9档
a=request("gya09")
b=request("gyb09")
c=request("gyc09")
nMax=a
nMin=a
if (a>b) and (b>c)then
nMax=a
nMin=c
end if
if (a>c) and (c>b)then
nMax=a
nMin=b
end if
if (b>a) and (a>c)then
nMax=b
nMin=c
end if
if (b>c) and (c>a)then
nMax=b
nMin=a
end if
if (c>a) and (a>b)then
nMax=c
nMin=b
end if
if (c>b) and (b>a)then
nMax=c
nMin=a
end if
if (a=b) and (a>c)then
nMax=a'也等于b
nMin=c
end if
if (a=b) and (a<c)then
nMax=c
nMin=a
end if
if (b=c) and (b>a)then
nMax=b'也等于c
nMin=a
end if
if (b=c) and (b<a)then
nMax=a
nMin=b
end if
if (c=a) and (c>b)then
nMax=c'也等于a
nMin=b
end if
if (c=a) and (c<b)then
nMax=b
nMin=c
end if
if (a=b) and (b=c)then
s=0
end if
s=((nMax-nMin)/nMin)
rs.addnew
rs("gya0")=a
rs("gyb0")=b
rs("gyc0")=c
rs("gwuc")=s
rs("gdangw")=gdangw
rs.update
rs.movenext
gdangw=request("gdangw10") '写入10档
a=request("gya010")
b=request("gyb010")
c=request("gyc010")
nMax=a
nMin=a
if (a>b) and (b>c)then
nMax=a
nMin=c
end if
if (a>c) and (c>b)then
nMax=a
nMin=b
end if
if (b>a) and (a>c)then
nMax=b
nMin=c
end if
if (b>c) and (c>a)then
nMax=b
nMin=a
end if
if (c>a) and (a>b)then
nMax=c
nMin=b
end if
if (c>b) and (b>a)then
nMax=c
nMin=a
end if
if (a=b) and (a>c)then
nMax=a'也等于b
nMin=c
end if
if (a=b) and (a<c)then
nMax=c
nMin=a
end if
if (b=c) and (b>a)then
nMax=b'也等于c
nMin=a
end if
if (b=c) and (b<a)then
nMax=a
nMin=b
end if
if (c=a) and (c>b)then
nMax=c'也等于a
nMin=b
end if
if (c=a) and (c<b)then
nMax=b
nMin=c
end if
if (a=b) and (b=c)then
s=0
end if
s=((nMax-nMin)/nMin)
rs.addnew
rs("gya0")=a
rs("gyb0")=b
rs("gyc0")=c
rs("gwuc")=s
rs("gdangw")=gdangw
rs.update
rs.movenext
gdangw=request("gdangw11") '写入11档
a=request("gya011")
b=request("gyb011")
c=request("gyc011")
nMax=a
nMin=a
if (a>b) and (b>c)then
nMax=a
nMin=c
end if
if (a>c) and (c>b)then
nMax=a
nMin=b
end if
if (b>a) and (a>c)then
nMax=b
nMin=c
end if
if (b>c) and (c>a)then
nMax=b
nMin=a
end if
if (c>a) and (a>b)then
nMax=c
nMin=b
end if
if (c>b) and (b>a)then
nMax=c
nMin=a
end if
if (a=b) and (a>c)then
nMax=a'也等于b
nMin=c
end if
if (a=b) and (a<c)then
nMax=c
nMin=a
end if
if (b=c) and (b>a)then
nMax=b'也等于c
nMin=a
end if
if (b=c) and (b<a)then
nMax=a
nMin=b
end if
if (c=a) and (c>b)then
nMax=c'也等于a
nMin=b
end if
if (c=a) and (c<b)then
nMax=b
nMin=c
end if
if (a=b) and (b=c)then
s=0
end if
s=((nMax-nMin)/nMin)
rs.addnew
rs("gya0")=a
rs("gyb0")=b
rs("gyc0")=c
rs("gwuc")=s
rs("gdangw")=gdangw
rs.update
rs.movenext
gdangw=request("gdangw12") '写入12档
a=request("gya012")
b=request("gyb012")
c=request("gyc012")
nMax=a
nMin=a
if (a>b) and (b>c)then
nMax=a
nMin=c
end if
if (a>c) and (c>b)then
nMax=a
nMin=b
end if
if (b>a) and (a>c)then
nMax=b
nMin=c
end if
if (b>c) and (c>a)then
nMax=b
nMin=a
end if
if (c>a) and (a>b)then
nMax=c
nMin=b
end if
if (c>b) and (b>a)then
nMax=c
nMin=a
end if
if (a=b) and (a>c)then
nMax=a'也等于b
nMin=c
end if
if (a=b) and (a<c)then
nMax=c
nMin=a
end if
if (b=c) and (b>a)then
nMax=b'也等于c
nMin=a
end if
if (b=c) and (b<a)then
nMax=a
nMin=b
end if
if (c=a) and (c>b)then
nMax=c'也等于a
nMin=b
end if
if (c=a) and (c<b)then
nMax=b
nMin=c
end if
if (a=b) and (b=c)then
s=0
end if
s=((nMax-nMin)/nMin)
rs.addnew
rs("gya0")=a
rs("gyb0")=b
rs("gyc0")=c
rs("gwuc")=s
rs("gdangw")=gdangw
rs.update
rs.movenext
gdangw=request("gdangw13") '写入13档
a=request("gya013")
b=request("gyb013")
c=request("gyc013")
nMax=a
nMin=a
if (a>b) and (b>c)then
nMax=a
nMin=c
end if
if (a>c) and (c>b)then
nMax=a
nMin=b
end if
if (b>a) and (a>c)then
nMax=b
nMin=c
end if
if (b>c) and (c>a)then
nMax=b
nMin=a
end if
if (c>a) and (a>b)then
nMax=c
nMin=b
end if
if (c>b) and (b>a)then
nMax=c
nMin=a
end if
if (a=b) and (a>c)then
nMax=a'也等于b
nMin=c
end if
if (a=b) and (a<c)then
nMax=c
nMin=a
end if
if (b=c) and (b>a)then
nMax=b'也等于c
nMin=a
end if
if (b=c) and (b<a)then
nMax=a
nMin=b
end if
if (c=a) and (c>b)then
nMax=c'也等于a
nMin=b
end if
if (c=a) and (c<b)then
nMax=b
nMin=c
end if
if (a=b) and (b=c)then
s=0
end if
s=((nMax-nMin)/nMin)
rs.addnew
rs("gya0")=a
rs("gyb0")=b
rs("gyc0")=c
rs("gwuc")=s
rs("gdangw")=gdangw
rs.update
rs.movenext
gdangw=request("gdangw14") '写入14档
a=request("gya014")
b=request("gyb014")
c=request("gyc014")
nMax=a
nMin=a
if (a>b) and (b>c)then
nMax=a
nMin=c
end if
if (a>c) and (c>b)then
nMax=a
nMin=b
end if
if (b>a) and (a>c)then
nMax=b
nMin=c
end if
if (b>c) and (c>a)then
nMax=b
nMin=a
end if
if (c>a) and (a>b)then
nMax=c
nMin=b
end if
if (c>b) and (b>a)then
nMax=c
nMin=a
end if
if (a=b) and (a>c)then
nMax=a'也等于b
nMin=c
end if
if (a=b) and (a<c)then
nMax=c
nMin=a
end if
if (b=c) and (b>a)then
nMax=b'也等于c
nMin=a
end if
if (b=c) and (b<a)then
nMax=a
nMin=b
end if
if (c=a) and (c>b)then
nMax=c'也等于a
nMin=b
end if
if (c=a) and (c<b)then
nMax=b
nMin=c
end if
if (a=b) and (b=c)then
s=0
end if
s=((nMax-nMin)/nMin)
rs.addnew
rs("gya0")=a
rs("gyb0")=b
rs("gyc0")=c
rs("gwuc")=s
rs("gdangw")=gdangw
rs.update
rs.movenext
gdangw=request("gdangw15") '写入15档
a=request("gya015")
b=request("gyb015")
c=request("gyc015")
nMax=a
nMin=a
if (a>b) and (b>c)then
nMax=a
nMin=c
end if
if (a>c) and (c>b)then
nMax=a
nMin=b
end if
if (b>a) and (a>c)then
nMax=b
nMin=c
end if
if (b>c) and (c>a)then
nMax=b
nMin=a
end if
if (c>a) and (a>b)then
nMax=c
nMin=b
end if
if (c>b) and (b>a)then
nMax=c
nMin=a
end if
if (a=b) and (a>c)then
nMax=a'也等于b
nMin=c
end if
if (a=b) and (a<c)then
nMax=c
nMin=a
end if
if (b=c) and (b>a)then
nMax=b'也等于c
nMin=a
end if
if (b=c) and (b<a)then
nMax=a
nMin=b
end if
if (c=a) and (c>b)then
nMax=c'也等于a
nMin=b
end if
if (c=a) and (c<b)then
nMax=b
nMin=c
end if
if (a=b) and (b=c)then
s=0
end if
s=((nMax-nMin)/nMin)
rs.addnew
rs("gya0")=a
rs("gyb0")=b
rs("gyc0")=c
rs("gwuc")=s
rs("gdangw")=gdangw
rs.update
rs.movenext
%>
[ 本帖最后由 ashimaxigo 于 2013-1-17 23:07 编辑 ]