링크: https://www.acmicpc.net/problem/6603
유형: 조합
난이도: 실버2
스스로 풀었는가? ✅
import sys
from itertools import combinations
readline = sys.stdin.readline
input = readline().rstrip('\n')
while input != '0':
arr = list(map(int, input.split()))
k = arr[0]
arr = arr[1:]
LOTTO_LEN = 6
combs = combinations(arr, LOTTO_LEN)
for comb in combs:
output = ' '.join(map(str, comb))
print(output)
print()
input = readline().rstrip('\n')
k, numbers = arr[0], arr[1:]
이 문제를 풀면서 파이썬에는 do-while 문이 없다는 걸 알았다..
[ktb-algorithm-study] 2주차