fork download
  1. #include <iostream>
  2. #include <algorithm>
  3. #include <string>
  4. #include <vector>
  5.  
  6. int main(){
  7.  
  8. std::vector<std::string> vec;
  9. vec.push_back("stack123");
  10. vec.push_back("STackOverflow");
  11.  
  12. for ( int i=0; i<vec.size(); ++i )
  13. {
  14. std::string & str = vec[i];
  15. std::sort(str.begin(), str.end());
  16. }
  17.  
  18. for ( int i=0; i<vec.size(); ++i )
  19. {
  20. std::cout << vec[i] << std::endl;
  21. }
  22. return 0;
  23. }
Success #stdin #stdout 0.02s 2816KB
stdin
Standard input is empty
stdout
123ackst
OSTacefklorvw