#include<bits/stdc++.h> using namespace std; int main() { char a[11]; int n; while(cin>>n) { while(n--) { cin>>a; int l = strlen(a); sort(a,a+l); do{ cout<<a<<endl; } while(next_permutation(a,a+l)); cout<<endl; } } return 0; }
Saturday, April 2, 2016
UVA 10098
Labels:
UVA Solution
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Thank you for commenting. Please wait for response :)