fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. bool f(char ch1,char ch2){
  4. if(tolower(ch1)!=tolower(ch2)){
  5. return tolower(ch1)<tolower(ch2);
  6. }
  7. return ch1<ch2;
  8. }
  9. int main() {
  10. // your code goes here
  11. string str;
  12. cin>>str;
  13. sort(str.begin(),str.end(),f);
  14. cout<<str<<endl;
  15. return 0;
  16. }
Success #stdin #stdout 0s 16064KB
stdin
bAdC
stdout
AbCd