Skip to content

Commit e74344b

Browse files
committed
[BOJ] 6603 로또 (S2)
1 parent 0473992 commit e74344b

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

박예진/5주차/260128.cpp

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#include <iostream>
2+
#include <vector>
3+
using namespace std;
4+
5+
int k;
6+
int arr[14];
7+
vector<int> v;
8+
9+
void combi(int idx, int depth){
10+
if (depth == 6) {
11+
for(auto iter : v) cout << iter << " ";
12+
cout << "\n";
13+
return;
14+
}
15+
16+
for(int i = idx; i < k; i++){
17+
v.push_back(arr[i]);
18+
combi(i + 1, depth + 1);
19+
v.pop_back();
20+
}
21+
}
22+
23+
int main() {
24+
ios::sync_with_stdio(false);
25+
cin.tie(0); cout.tie(0);
26+
27+
while(true) {
28+
cin >> k;
29+
if (k == 0) break;
30+
for(int i = 0; i < k; i++){
31+
cin >> arr[i];
32+
}
33+
combi(0, 0);
34+
cout << "\n";
35+
}
36+
37+
return 0;
38+
}

0 commit comments

Comments
 (0)