|
多算了,是108吧。直接暴力循环吧
- Option Base 1
- Function Permut7()
- Dim ar(200, 1), br()
- ReDim br(1 To 7)
- For i = 1 To 7
- For j = 1 To 7
- For k = 1 To 7
- For l = 1 To 7
- For m = 1 To 7
- For n = 1 To 7
- For o = 1 To 7
- br(i) = 1: br(j) = 1: br(k) = 1
- br(l) = 1: br(m) = 1: br(n) = 1: br(o) = 1
- s = Join(br, "")
- If Len(s) = 7 Then
- If i + k = m + n And i + j = n + o And j + m = k + o Then
- cnt = cnt + 1
- ar(cnt, 1) = i & "|" & j & "|" & k & "|" & l & "|" & m & "|" & n & "|" & o
- End If
- End If
- ReDim br(1 To 7)
- Next o, n, m, l, k, j, i
- [b2].Resize(UBound(ar)) = ar
- End Function
复制代码 |
|