fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. string s;
  7. cin >> s;
  8.  
  9. for (int i = 0; i < s.length() - 1; i++)
  10. {
  11. for (int j = i + 1; j < s.length(); j++)
  12. {
  13. if (int(s[i]) > int(s[j]))
  14. {
  15. char t = s[i];
  16. s[i] = s[j];
  17. s[j] = t;
  18. }
  19. }
  20. }
  21. cout << s;
  22. }
  23.  
Success #stdin #stdout 0s 5284KB
stdin
aiuoefhwefhioufnhrfb 
stdout
abeeffffhhhiinooruuw