We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ef3ba43 commit d6957b9Copy full SHA for d6957b9
1 file changed
weekly/week03/BOJ_6603_로또/gyuhyeok99.cpp
@@ -0,0 +1,47 @@
1
+#include <iostream>
2
+#include <algorithm>
3
+#include <vector>
4
+
5
+using namespace std;
6
7
+int k;
8
+vector<int> v;
9
10
+void combi(int start, vector<int> b) {
11
+ if (b.size() == 6) {
12
+ for (int i = 0; i < 6; i++) {
13
+ cout << v[b[i]] << ' ';
14
+ }
15
+ cout << '\n';
16
+ return;
17
18
19
+ for (int i = start + 1; i < v.size(); i++) {
20
+ b.push_back(i);
21
+ combi(i, b);
22
+ b.pop_back();
23
24
+}
25
+int main() {
26
+ ios_base::sync_with_stdio(false);
27
+ cin.tie(NULL);
28
+ cout.tie(NULL);
29
30
+ while (true) {
31
+ v.clear();
32
+ cin >> k;
33
+ if (k == 0) {
34
+ break;
35
36
37
+ for (int i = 0; i < k; i++) {
38
+ int num;
39
+ cin >> num;
40
+ v.push_back(num);
41
42
+ combi(-1, {});
43
44
45
46
+ return 0;
47
0 commit comments