You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
328 B
21 lines
328 B
#include<bits/stdc++.h>
|
|
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;
|
|
}
|