Advertisement
Guest User

Untitled

a guest
Mar 20th, 2018
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.39 KB | None | 0 0
  1. string permutations[SIZE];
  2. bool used[SIZE];
  3. string v[SIZE];
  4.  
  5. void generate_permutations(int x) {
  6.     if (x == SIZE) {
  7.         // esegui operazioni sulla permutazione
  8.         return
  9.     }
  10.     for (int i = 0; i < SIZE; i++) {
  11.         if (used[i]) continue;
  12.         permutations[x] = v[i];
  13.         used[i] = true;
  14.         generate_permutations(x + 1);
  15.         used[i] = false;
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement