fork download
  1. #include <iostream>
  2. #include <bitset>
  3. using namespace std;
  4.  
  5. int main() {
  6. // your code goes here
  7. int s=0b1100110;
  8. cout<<"s:"<<s<<endl;
  9. cout<<"s:"<<bitset<10>(s)<<endl;
  10. for(int s0=s;s0;s0=(s0-1)&s)
  11. cout<<bitset<8>(s0)<<endl;
  12. return 0;
  13. }
Success #stdin #stdout 0s 15232KB
stdin
Standard input is empty
stdout
s:102
s:0001100110
01100110
01100100
01100010
01100000
01000110
01000100
01000010
01000000
00100110
00100100
00100010
00100000
00000110
00000100
00000010