Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<cstdio>
- #include<iostream>
- #include<algorithm>
- #include<cstring>
- using namespace std;
- int main()
- {
- int t,len;
- char ch;
- char str[10000];
- scanf("%d%c",&t,&ch);
- while(t--)
- {
- gets(str);
- len=strlen(str);
- sort(str,str+len);
- do
- {
- cout<<str<<endl;
- }while(next_permutation(str,str+len));
- cout<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement