뚜루리 2024. 10. 9. 00:00
728x90
320x100

 

 

구현

from itertools import combinations

while True:
	I = list(map(int, input().split()))

	k = I[0]
	arr = I[1:]
	if k == 0:
		break

	for comb in combinations(arr, 6):
		for u in comb:
			print(u, end=' ')
		print()
	print()
  • Cmbinations 함수를 활용하면 모든 경우의 수를 뽑을 수 있음

 

 

728x90
320x100