#include using namespace std; //C++STL中全排列函数next_permutation的使用 // https://blog.csdn.net/ac_gibson/article/details/45308645 int main() { int a[3] = { 3,1,2 }; //快速排序 sort(a, a + 3); //全排列 do { cout << a[0] << a[1] << a[2] << endl; } while (next_permutation(a, a + 3)); return 0; }