fork download
  1. #include <iostream>
  2. using namespace std;
  3. #include <bits/stdc++.h>
  4.  
  5. int main() {
  6. // your code goes here
  7. return 0;
  8. int n = 3;
  9. for (int b = 0; b < (1<<n); b++) {
  10. vector<int> subset;
  11. for (int i = 0; i < n; i++) {
  12. if (b&(1<<i)) {subset.push_back(i); cout << "b: " << b << "i: " << i;}
  13. }
  14. }
  15. }
  16.  
  17.  
Success #stdin #stdout 0s 4272KB
stdin
Standard input is empty
stdout
Standard output is empty