Skip to content

Instantly share code, notes, and snippets.

@erickguan
Created September 18, 2013 15:39
Show Gist options
  • Select an option

  • Save erickguan/6611085 to your computer and use it in GitHub Desktop.

Select an option

Save erickguan/6611085 to your computer and use it in GitHub Desktop.
#include <iostream>
#include <vector>
#include <algorithm>
int main()
{
std::vector<int> a{1, 2, 3, 4, 5, 6};
do {
std::cout << a[0] << a[1] << a[2] << a[3] << a[4] << a[5] << std::endl;
} while (std::next_permutation(a.begin(), a.end()));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment