关系数组
1  0  2
1  0  5
2  1  3 
2  1  4
4  2  6 
4  2  5排列有多少种组合 用VBS如:1——5
   1——2——3
   1——2——4——6
   1——2——4——5

解决方案 »

  1.   

    dim(1,0,2) 
    dim(1,0,5) 
    dim(2,1,3) 
    dim(2,1,4) 
    dim(4,2,6) 
    dim(4,2,5)排列上面的数组,有多少种组合,用VBS,这样的描述可以了嘛??
      

  2.   

    关系数组 ,以下是参数 
    1  0  2 
    1  0  5 
    2  1  3 
    2  1  4 
    4  2  6 
    4  2  5 如:1——2 
      1——2——3 
      1——2——4——6 
      1——2——4——5 
     
    用vbs实现所有的排列组合输出 
      

  3.   


    [Quote=引用 31 楼 jhone99 的回复:]
    VB codeDim a() As StringPrivate Sub Command1_Click()
            a = Split(Replace("1  0  2,1  0  5,2  1  3,2  1  4,4  2  6,4  2  5", "  ", ""), ",")
        
        Call s_FindNext("1", 0, "1")End Sub
    Private Sub s_FindNext(ByVal strFind As String, ByVal intOrder As Integer, ByVal strString As String)
        Dim I As Integer
        Dim blnHave As Boolean
        
        For I = 0 To UBound(a)
            If Mid(a(I), 1, 1) = strFind And Mid(a(I), 2, 1) = intOrder Then
                Call s_FindNext(Mid(a(I), 3, 1), intOrder + 1, strString & "--" & Mid(a(I), 3, 1))
                blnHave = True
            End If
        Next I
        
        If Not blnHave Then
            Debug.Print strString
        End If
        
    End Sub
      

  4.   

    Dim a() As StringPrivate Sub Command1_Click()
            a = Split(Replace("1  0  2,1  0  5,2  1  3,2  1  4,4  2  6,4  2  5", "  ", ""), ",")
        
        Call s_FindNext("1", 0, "1")End Sub
    Private Sub s_FindNext(ByVal strFind As String, ByVal intOrder As Integer, ByVal strString As String)
        Dim I As Integer
        Dim blnHave As Boolean
        
        For I = 0 To UBound(a)
            If Mid(a(I), 1, 1) = strFind And Mid(a(I), 2, 1) = intOrder Then
                Call s_FindNext(Mid(a(I), 3, 1), intOrder + 1, strString & "--" & Mid(a(I), 3, 1))
                blnHave = True
            End If
        Next I
        
        If Not blnHave Then
            Debug.Print strString
        End If
        
    End Sub
      

  5.   

    谢谢大家。。送上衷心的祝福。。本来想给每个人都加分的。可惜分不够,大家多多包含  。。好人有好报的。哈哈  特别要谢谢jhone99  和 tongnaifu  。