fork(9) download
  1. #include <iostream>
  2. #include <string>
  3. #include <algorithm>
  4. using namespace std;
  5.  
  6. int main() {
  7.  
  8. string s("ABC");
  9. do {
  10. cout << s << endl;
  11. } while (next_permutation(s.begin(), s.end()));
  12.  
  13. return 0;
  14. }
Success #stdin #stdout 0s 3272KB
stdin
Standard input is empty
stdout
ABC
ACB
BAC
BCA
CAB
CBA