<%
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)
%>

解决方案 »

  1.   

    xiaolei1982 的答案用call   show(2)只能得到2+1 
    2+3 
    2+4 
    我要的是1+2 
    1+3 
    1+4 2+1 
    2+3 
    2+4 3+1 
    3+2 
    3+4 
      

  2.   

    可以给个call   show(5)的结果吗 
      

  3.   

    show(5) i不能大于数组元素的个数,最多是show(4)
      

  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)
    %>
      

  5.   

    就是循环次数没弄明白show(2)是到
    3+1  
    3+2  
    3+4  ,
    那show(3)是到几?
    show(4)到几?
    所以循环的次数没有弄好,
      

  6.   

    <%
    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)
    %>
      

  7.   

    <%
    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