We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0473992 commit e74344bCopy full SHA for e74344b
박예진/5주차/260128.cpp
@@ -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
35
36
37
+ return 0;
38
0 commit comments