fork download
  1. #include <string>
  2. #include <iostream>
  3.  
  4. int main()
  5. {
  6. std::string a = "1,2,3,4,5";
  7. std::string b(a.rbegin(), a.rend());
  8. std::cout << a << std::endl;
  9. std::cout << b << std::endl;
  10. }
  11.  
Success #stdin #stdout 0s 3428KB
stdin
Standard input is empty
stdout
1,2,3,4,5
5,4,3,2,1