from itertools import combinations
x = set(range(6))
print([(c, x-set(c)) for c in combinations(x,3) if 0 in c])
[((0, 1, 2), {3, 4, 5}),
((0, 1, 3), {2, 4, 5}),
((0, 1, 4), {2, 3, 5}),
((0, 1, 5), {2, 3, 4}),
((0, 2, 3), {1, 4, 5}),
((0, 2, 4), {1, 3, 5}),
((0, 2, 5), {1, 3, 4}),
((0, 3, 4), {1, 2, 5}),
((0, 3, 5), {1, 2, 4}),
((0, 4, 5), {1, 2, 3})]
【 在 javame (javame) 的大作中提到: 】
: 请用编程解决问题
: 有a,b,c,d,e,f一共6位足球运动员
: 拆成3个队员 === 3个队员的比赛。编程,
: ...................
--
FROM 221.217.106.*