fork(4) download
  1. #include <iostream>
  2. #include <string>
  3. #include <algorithm>
  4. int main()
  5. {
  6. std::string s = "hello";
  7. std::iter_swap(s.begin(), s.rbegin());
  8. std::cout << s << '\n';
  9. }
  10.  
Success #stdin #stdout 0.01s 2856KB
stdin
Standard input is empty
stdout
oellh