51nod 1384 全排列

直接使用STL函数就可以

AC代码:

#include<bits/stdc++.h>
using namespace std;
int main()
{
char a[100];
int n;
while(cin>>a)
{
int n=strlen(a);
sort(a,a+n);
do
{
cout<<a<<endl;
}while(next_permutation(a,a+n));
}

return 0;
}

posted @ 2017-08-16 16:39  sortmin  阅读(80)  评论(0编辑  收藏  举报