fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. void printVec(vector<char> f){
  5. for(int i=0;i<f.size();i++){
  6. cout << f[i];
  7. }
  8. cout << endl;
  9. }
  10. int main() {
  11. int t;
  12. cin >> t;
  13. while(t--){
  14. string s;
  15. cin >> s;
  16. vector<char> a;
  17. for(int i=0;i<s.size();i++){
  18. a.push_back(s[i]);
  19. }
  20. sort(a.begin(),a.end());
  21. printVec(a);
  22. }
  23. return 0;
  24. }
Success #stdin #stdout 0.01s 5272KB
stdin
5
a
ab
aba
abcdefbac
mohammad
stdout
a
ab
aab
aabbccdef
aadhmmmo