next_permutation stringや他のコンテナの全ての順列を生成する。 #include <algorithm> ... string str = "ABCDEF"; do { cout << str << endl; } while(next_permutation(str.begin(), str.end())); Result: ABCDEF ABCDFE ABCEDF ABCEFD ... FEDCBA (計 6! = 720個の</algorithm>…
引用をストックしました
引用するにはまずログインしてください
引用をストックできませんでした。再度お試しください
限定公開記事のため引用できません。