fork download
  1. #include <iostream>
  2. using namespace std;
  3. bool hasOnlySix(unsigned short int p)
  4. {
  5. int count = 0;
  6. unsigned int d = p;
  7. for(char r = 0; r!=10;r++)
  8. {
  9. count+=(d&1);
  10. d = d>>1;
  11. }
  12. return count==6;
  13. }
  14.  
  15. void writeDays(unsigned short int p)
  16. {
  17. unsigned int d = p;
  18. char wr;
  19. for(char r = 0; r!=10;r++)
  20. {
  21. wr = d&1?'1':'0';
  22. cout<<wr;
  23. d = d>>1;
  24. }
  25. cout<<endl;
  26. }
  27. int main()
  28. {
  29. unsigned short int k;
  30. for(k = 0; k!=1024;k++)
  31. {
  32. if(hasOnlySix(k))
  33. writeDays(k);
  34. }
  35. return 0;
  36. }
Success #stdin #stdout 0s 2852KB
stdin
Standard input is empty
stdout
1111110000
1111101000
1111011000
1110111000
1101111000
1011111000
0111111000
1111100100
1111010100
1110110100
1101110100
1011110100
0111110100
1111001100
1110101100
1101101100
1011101100
0111101100
1110011100
1101011100
1011011100
0111011100
1100111100
1010111100
0110111100
1001111100
0101111100
0011111100
1111100010
1111010010
1110110010
1101110010
1011110010
0111110010
1111001010
1110101010
1101101010
1011101010
0111101010
1110011010
1101011010
1011011010
0111011010
1100111010
1010111010
0110111010
1001111010
0101111010
0011111010
1111000110
1110100110
1101100110
1011100110
0111100110
1110010110
1101010110
1011010110
0111010110
1100110110
1010110110
0110110110
1001110110
0101110110
0011110110
1110001110
1101001110
1011001110
0111001110
1100101110
1010101110
0110101110
1001101110
0101101110
0011101110
1100011110
1010011110
0110011110
1001011110
0101011110
0011011110
1000111110
0100111110
0010111110
0001111110
1111100001
1111010001
1110110001
1101110001
1011110001
0111110001
1111001001
1110101001
1101101001
1011101001
0111101001
1110011001
1101011001
1011011001
0111011001
1100111001
1010111001
0110111001
1001111001
0101111001
0011111001
1111000101
1110100101
1101100101
1011100101
0111100101
1110010101
1101010101
1011010101
0111010101
1100110101
1010110101
0110110101
1001110101
0101110101
0011110101
1110001101
1101001101
1011001101
0111001101
1100101101
1010101101
0110101101
1001101101
0101101101
0011101101
1100011101
1010011101
0110011101
1001011101
0101011101
0011011101
1000111101
0100111101
0010111101
0001111101
1111000011
1110100011
1101100011
1011100011
0111100011
1110010011
1101010011
1011010011
0111010011
1100110011
1010110011
0110110011
1001110011
0101110011
0011110011
1110001011
1101001011
1011001011
0111001011
1100101011
1010101011
0110101011
1001101011
0101101011
0011101011
1100011011
1010011011
0110011011
1001011011
0101011011
0011011011
1000111011
0100111011
0010111011
0001111011
1110000111
1101000111
1011000111
0111000111
1100100111
1010100111
0110100111
1001100111
0101100111
0011100111
1100010111
1010010111
0110010111
1001010111
0101010111
0011010111
1000110111
0100110111
0010110111
0001110111
1100001111
1010001111
0110001111
1001001111
0101001111
0011001111
1000101111
0100101111
0010101111
0001101111
1000011111
0100011111
0010011111
0001011111
0000111111