fork(2) download
  1. #include <string>
  2. #include <iostream>
  3. #include <iomanip>
  4. #include <algorithm>
  5.  
  6. using namespace std;
  7.  
  8. auto g(string s){sort(begin(s),end(s),[](char a, char b){return(a|32)<(b|32);});return s;}
  9.  
  10. int main(int argc, const char * argv[])
  11. {
  12. string q = "sahgcvasASDADGSASvghvavdnmb";
  13. cout << q << " -> " << g(q) << endl;
  14. }
  15.  
  16.  
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
sahgcvasASDADGSASvghvavdnmb  ->  aaAAAabcdDDggGhhmnSSsSsvvvv