<%
sub show(i)
dim s
dim A
INT Acount
s="1,2,3,4"
A=Split(S,",")
ACount=ubound(A)
for j=0 to Acount
if cstr(i)=1 then
Response.write A(j) & "+ <br> "
else
if A(j)<>cstr(i) then
Response.write cstr(i) & "+" & A(j) & "<br> "
end if
end if
next
end sub
call show(2)
%>
sub show(i)
dim s
dim A
INT Acount
s="1,2,3,4"
A=Split(S,",")
ACount=ubound(A)
for j=0 to Acount
if cstr(i)=1 then
Response.write A(j) & "+ <br> "
else
if A(j)<>cstr(i) then
Response.write cstr(i) & "+" & A(j) & "<br> "
end if
end if
next
end sub
call show(2)
%>
2+3
2+4
我要的是1+2
1+3
1+4 2+1
2+3
2+4 3+1
3+2
3+4
dim s
dim A
INT Acount
s="1,2,3,4"
A=Split(S,",")
ACount=ubound(A)
sub show(i)for j=0 to Acount
if cstr(i)=1 then
Response.write A(j) & "+ <br> "
else
call pailie(j+1)
end if
next
end sub sub pailie(i)
for m=0 to Acount
if A(m)<>cstr(i) then
Response.write cstr(i) & "+" & A(m) & "<br> "
end if
next
end sub
call show(3)
%>
3+1
3+2
3+4 ,
那show(3)是到几?
show(4)到几?
所以循环的次数没有弄好,
dim s
dim A
dim mINT Acount
s="1,2,3,4"
A=Split(S,",")
ACount=ubound(A)
sub show(i)
n=1
for j=0 to Acount
if cstr(i)=1 then
Response.write A(j) & "+ <br> "
else
if n<=i+1 then
call pailie(n)
n=n+1
end if
end if
next
end sub sub pailie(i)
for m=0 to Acount
if A(m)<>cstr(i) then
Response.write cstr(i) & "+" & A(m) & "<br> "
end if
next
end sub
call show(2)
%>
dim s
dim A
dim mINT Acount
s="1,2,3,4"
A=Split(S,",")
ACount=ubound(A)
sub show(i)
n=1
for j=0 to Acount
if cstr(i)=1 then
Response.write A(j) & "+ <br> "
else
if n<=i+1 then
call pailie(n)
n=n+1
end if
end if
next
end sub sub pailie(i)
for m=0 to Acount
if A(m)<>cstr(i) then
Response.write cstr(i) & "+" & A(m) & "<br> "
end if
next
end sub
for k=1 to ACount+1
Response.write k & "个组合结果:<br>"
call show(k)
next
%>调用出来的结果好像不对哦^_^1个组合结果:
1+
2+
3+
4+
2个组合结果:
1+2
1+3
1+4
2+1
2+3
2+4
3+1
3+2
3+4
3个组合结果:
1+2
1+3
1+4
2+1
2+3
2+4
3+1
3+2
3+4
4+1
4+2
4+3
4个组合结果:
1+2
1+3
1+4
2+1
2+3
2+4
3+1
3+2
3+4
4+1
4+2
4+3