fork download
  1. #include <algorithm>
  2. #include <iostream>
  3. #include <string>
  4.  
  5.  
  6. int main()
  7. {
  8. std::string s = "abc";
  9.  
  10. do {
  11. std::cout << s << std::endl;
  12. } while (std::next_permutation(s.begin(), s.end()));
  13. }
  14.  
Success #stdin #stdout 0s 3468KB
stdin
Standard input is empty
stdout
abc
acb
bac
bca
cab
cba