赞
踩
全排列(STL)
- #include <iostream>
- #include <algorithm>
- #include <cstring>
- using namespace std;
- int main(){
- int t;
- cin >> t;
- while(t--){
- char s[100];
- cin >> s;
- int l=strlen(s);
- sort(s,s+l);
- do{
- for (int i = 0; i < l;i++) cout << s[i];
- cout << endl;
- }while(next_permutation(s,s+l));
- cout << endl;
- }
- return 0;
- }

Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。