fork download
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. string odwrockolejnoscduzychliter(string x){
  6. string odw;
  7. for(int i = 0; i<x.length();i++){
  8. if(isupper ( x[i]) )
  9. odw= x[i]+ odw;
  10. }
  11. int l = 0;
  12. for(int y = 0; y<x.length();y++){
  13. if(isupper ( x[y]) ){
  14. x[y] = odw [l];
  15. l++;
  16. }
  17. }
  18. return x;
  19. }
  20.  
  21. int main() {
  22. cout<<odwrockolejnoscduzychliter("aAbbgXxfGhh")<<endl;
  23. return 0;
  24. }
Success #stdin #stdout 0s 3476KB
stdin
Standard input is empty
stdout
aGbbgXxfAhh