문제 링크: https://www.acmicpc.net/problem/6603
백준 알고리즘 기초 2/2 520에서 6번째 - 6603번 로또를 풀어보았다.
풀이:
파이썬의 경우 combinations을 이용했다.
C++
Python
from itertools import combinations
while 1:
inp=list(map(int,input().split()))
n=inp[0]
num=inp[1:]
if n==0: break
for i in combinations(num,6):
for j in i:
print(j,end=' ')
print()
print()
Java
'코테용 문제풀이 > 백준' 카테고리의 다른 글
퇴사 풀이 (0) | 2023.01.29 |
---|---|
암호 만들기 풀이 (0) | 2023.01.28 |
외판원 순회 2 풀이 (0) | 2023.01.25 |
차이를 최대로 풀이 (0) | 2023.01.25 |
모든 순열 풀이 (0) | 2023.01.25 |