回答編集履歴

1

微修正

2020/06/29 23:45

投稿

episteme
episteme

スコア16614

test CHANGED
@@ -42,7 +42,7 @@
42
42
 
43
43
 
44
44
 
45
- // N個の中からM個選ぶための bits : N-M個のfalse と M個の true
45
+ // bits : N-M個のfalse と M個の true
46
46
 
47
47
  array<bool,N> bits;
48
48
 
@@ -82,7 +82,17 @@
82
82
 
83
83
  do {
84
84
 
85
+ string result;
86
+
87
+ for ( char ch : pattern ) {
88
+
89
+ if ( !result.empty() ) result += ',';
90
+
91
+ result += ch;
92
+
93
+ }
94
+
85
- cout << pattern << endl;
95
+ cout << result << endl;
86
96
 
87
97
  } while ( next_permutation(pattern.begin(),pattern.end()) );
88
98