Advertisement
nikbel

podmnojestva_sdvig

Mar 18th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.22 KB | None | 0 0
  1. M = [2, 5, 9]
  2. w = 4
  3. n = pow(2, w);
  4. i = 0
  5. while (i < n):
  6.     print("{", end = '')
  7.     j = 0
  8.     while (j < w):
  9.         if ( i & (1 << j)):
  10.             print(M[j], end = '')
  11.         j += 1
  12.     print("}")
  13.     i += 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement