|
组合5,130个结果
- Sub zhee()
- arr = [a5:b13]
- bz = [b2]
- ReDim scrr(1 To 10000, 1 To 2)
- m = UBound(arr)
- For a = 1 To m
- For b = 1 To m
- For c = 1 To m
- For d = 1 To m
- For e = 1 To m
- If d <> a And d <> b And d <> c And e <> a And e <> b And e <> c Then
- hj = arr(a, 2) + arr(b, 2) + arr(c, 2) - arr(d, 2) - arr(e, 2)
- If hj >= 0 And hj <= bz Then
- i = i + 1
- scrr(i, 1) = arr(a, 1) & " + " & arr(b, 1) & " + " & arr(c, 1) & " - " & arr(d, 1) & " - " & arr(e, 1)
- scrr(i, 2) = hj
- End If
- End If
- Next e, d, c, b, a
- Range("k5").Resize(i, 2) = scrr
- End Sub
复制代码
其他自己改。 |
评分
-
1
查看全部评分
-
|