Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Permute
//Title of this code #include <iostream> #include <string> using namespace std; // n! factorial void permuteString(string s, int j) { if (j == s.length()) { cout << s << endl; return; } for (int i = j; i < s.length(); ++i) { swap(s[i], s[j]); permuteString(s, j + 1); swap(s[i], s[j]); // swap back } } int main() { permuteString("abcd", 0); }
run
|
edit
|
history
|
help
0
hangman
vector of bool
Union and possible undefined behavior
accessibility on in-class typedefs
infix to postfix v 1.0
xxx
Dequeue Using STL List
program_solution_3
ccloader
#9