怎么得到一个数列的全排列
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <iterator>
using namespace std;
int main()
{
string str;
vector<string>strVec;
int n;
while(cin >> n)
{
for(int i =0; i < n;i++)
{
cin>>str;
strVec.push_back(str);
}
sort(strVec.begin(), strVec.end());
int icount = 0;
while (next_permutation(strVec.begin(), strVec.end()))
{
copy(strVec.begin(),strVec.end(),ostream_iterator<string>(cout," "));
cout<<endl;
icount++;
}
cout<<icount<<endl;
strVec.clear();
}
system("pause");
return 0;
}