Quick actions

cmd+k|ctrl+k

Navigation

Languages

Permutation

Snippet info

Language

Cpp

Visibility

unlisted

Author

legacy-anonymous

Created

2019-04-20T07:12:49Z

Updated

2019-04-20T07:12:49Z

#include <iostream>
#include <algorithm>

int main () {
  char chars[] = {'a', 'b', 'c'};
  int n = 3;

  std::sort (chars, chars+n);
  do {
    std::cout << chars << '\n';
  } while ( std::next_permutation(chars, chars+n) );

  return 0;
}
INFO