Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- vector<string> permutations;
- bool used[SIZE];
- string v[SIZE];
- void generate_permutations(int x) {
- if (x == SIZE) {
- // esegui operazioni sulla permutazione
- return
- }
- for (int i = 0; i < SIZE; i++) {
- if (used[i]) continue;
- permutations.push_back(v[i]);
- used[i] = true;
- generate_permutations(x + 1);
- used[i] = false;
- permutations.pop_back();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement