#include
#include
#include
#include
using namespace std;
int main()
{
int n;
cin >> n;
vector perm(n);
for(int i = 0; i < n; ++i)
perm[i] = i + 1;
do{
copy(perm.begin(), perm.end(), ostream_iterator (cout, " "));
cout << endl;
}while(next_permutation(perm.begin(), perm.end()));
return 0;
}
阅读(494) | 评论(0) | 转发(0) |