From 30ef9f5717ef5f2ceca089e56d834b4429dfb225 Mon Sep 17 00:00:00 2001 From: yjhss <20211420.sungshin.ac.kr> Date: Wed, 12 Apr 2023 19:29:19 +0900 Subject: [PATCH] =?UTF-8?q?#2=20:=2015650=5FN=EA=B3=BC=20M(2)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../15650_N\352\263\274 M(2).py" | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 "\354\235\264\355\213\260\354\234\240\354\247\204/15650_N\352\263\274 M(2).py" diff --git "a/\354\235\264\355\213\260\354\234\240\354\247\204/15650_N\352\263\274 M(2).py" "b/\354\235\264\355\213\260\354\234\240\354\247\204/15650_N\352\263\274 M(2).py" new file mode 100644 index 0000000..5cba603 --- /dev/null +++ "b/\354\235\264\355\213\260\354\234\240\354\247\204/15650_N\352\263\274 M(2).py" @@ -0,0 +1,12 @@ +from itertools import combinations #itertools의 combinations 함수 + +n,m = map(int, input().split()) # N과 M 입력받기 + +a = [] # [1,2,3,4 ..] +for i in range(1,n+1): + a.append(i) + +for i in combinations(a,m): # a에서 원소 개수 m개인 조합을 뽑는 것, 출력 + for j in i: + print(j,end=' ') + print() \ No newline at end of file