如何简化以下代码
哥们:问题来了! 以下是全排列的代码:请问各哥们,如何简化以下判断语句?先感谢咯! <script language=vbscript>
Function getAll(Array)
iMax = Ubound(Array) - 1
For i = 0 To iMax
For j=0 To iMax If j > i Then
If i=0 and j=1 then
Document.write(“包含”&Array(i)&Array(j)&"不包含"&Array(2)&Array(3)&Array(4)&Array(5)&" <br> ")
end if
If i=0 and j=2 then
Document.write(“包含”&Array(i)&Array(j)&"不包含"&Array(1)&Array(3)&Array(4)&Array(5)&" <br> ")
end if
If i=0 and j=3 then
Document.write(“包含”&Array(i)&Array(j)&"不包含"&Array(1)&Array(2)&Array(4)&Array(5)&" <br> ")
end if
If i=0 and j=4 then
Document.write(“包含”&Array(i)&Array(j)&"不包含"&Array(1)&Array(2)&Array(3)&Array(5)&" <br> ")
end if
If i=0 and j=5 then
Document.write(“包含”&Array(i)&Array(j)&"不包含"&Array(1)&Array(2)&Array(3)&Array(4)&" <br> ")
end if
If i=1 and j=2 then
Document.write(“包含”&Array(i)&Array(j)&"不包含"&Array(0)&Array(3)&Array(4)&Array(5)&" <br> ")
end if
If i=1 and j=3
then Document.write(“包含”&Array(i)&Array(j)&"不包含"&Array(0)&Array(2)&Array(4)&Array(5)&" <br> ")
end if
......
End If
Next
Next
End Function
Dim Array(6)
Array(0) = "a "
Array(1) = "b "
Array(2) = "c "
Array(3) = "d "
Array(4) = "e "
Array(5) = "f "
getAll(Array)
</script>