Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.34 KB | None | 0 0
  1. void f(int n) {
  2.     if (n%2) {
  3.         return;
  4.     }
  5.     int* set = // инит через malloc !
  6.     findComb(set, 0, n);   
  7. }
  8.  
  9. void findComb(int* set, int curr, int n) {
  10.     if (curr == n) {
  11.         if (checkComb(set, n)) {
  12.             prinComb(set, n));
  13.         }
  14.     }
  15.     else {
  16.         set[curr] = 0;
  17.         getComb(set, curr + 1, n); 
  18.         set[curr] = 1;
  19.         getComb(set, curr + 1, n);
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement