将数组或字符串排列 #include<bits/stdc++.h> using namespace std; int main() { char s[10]; cin>>s; sort(s,s+strlen(s)); do{ cout<<s<<endl; }while(next_permutation(s,s+strlen(s))); return 0; }