|
本帖最后由 micch 于 2023-12-7 21:17 编辑
0-15只要0开头的不重复的,我都不知道该说什么好了。 那不就是1-15的组合吗,0都固定在第一个了,还要求不重复,那后面也没有0 。 多余说一句0
改一下,输出为文件
- Sub TestSub()
- Dim iTxt As Object, k%, pth$
- pth = "D:"
- With CreateObject("Scripting.FileSystemObject")
- For i1 = 1 To 15
- For i2 = i1 + 1 To 15
- For i3 = i2 + 1 To 15
- For i4 = i3 + 1 To 15
- For i5 = i4 + 1 To 15
- For i6 = i5 + 1 To 15
- For i7 = i6 + 1 To 15
- For i8 = i7 + 1 To 15
- s = 0 & "," & i1 & "," & i2 & "," & i3 & "," & _
- i4 & "," & i5 & "," & i6 & "," & i7 & "," & i8
- If j Mod 1073 = 0 Then
- If k > 0 Then iTxt.Close
- j = 0: k = k + 1
- f = pth & k & ".txt"
- Set iTxt = .CreateTextFile(f)
- End If
- j = j + 1
- iTxt.write s & vbCrLf
- Next i8
- Next i7
- Next i6
- Next i5
- Next i4
- Next i3
- Next i2
- Next i1
- End With
- End Sub
复制代码
|
|