------解决方案-------------------- 可以尝试多重循环foreach( int i in list){int i in list{……} } 子层的集合排除父层以及父父层中的i
------解决方案--------------------
[code=VB.NET][/code] Dim shu() As String Dim s As Integer For a = 1 To 5
For b = 1 To 5 If b <> a Then For c = 1 To 5 If c <> b And c <> a Then For d = 1 To 5 If d <> b And d <> a And d <> c Then For f = 1 To 5 If f <> b And f <> a And f <> c And f <> d Then s += 1 ReDim Preserve shu(s) shu(s) = a & "," & b & "," & c & "," & d & "," & f MsgBox(shu(s)) End If Next End If Next End If Next End If Next Next
------解决方案--------------------
http://topic.csdn.net/u/20110616/13/1958e017-f132-4f26-90cb-3da8c0b4eed5.html
------解决方案-------------------- 傻一点的方法:5个位置循环5次,每次取一个字符,5次的话就5个,然后组合,最后输出。
------解决方案--------------------