//注意只有一组数据,否则OLE //题意:输出字符串的全排列 #include <iostream> #include <string> #include <algorithm> #include <cstdlib> #include <queue>//less算子 using namespace std; int main() { int i,j,k; char s[210]; //while(1) { memset(s,0,sizeof(s)); cin>>s; // if(s=="NULL") // break; int len = strlen(s); sort(s,s+len,less_equal<char >() ); do { for(i=0;i<len;i++) cout<<s[i]; cout<<endl; }while(next_permutation(s,s+len)); } //system("pause"); return 0; }