大哥 1~7能产生8位不重复的数字吗
下面做个参考吧
<%
function check(str)
str=str
dim i,s,n
s=split(str,",")
for i=0 to ubound(s)
Randomize '随机种子
n=Int((ubound(s)-0+1)*Rnd(now())+0)
response.write s(n)
if n=0 and n<>ubound(s) then
str=right(str,len(str)-len(s(n))-1)
elseif n=ubound(s) and n<>0 then
str=left(str,len(str)-len(s(n))-1)
else
str=replace(str,","&s(n)&",",",")
end if
s=split(str,",")
next
end function
str="0,1,2,3,4,5,6,7"
check str
%>