#include <iostream> using namespace std; bool hasOnlySix(unsigned short int p) { int count = 0; unsigned int d = p; for(char r = 0; r!=10;r++) { count+=(d&1); d = d>>1; } return count==6; } void writeDays(unsigned short int p) { unsigned int d = p; char wr; for(char r = 0; r!=10;r++) { wr = d&1?'1':'0'; cout<<wr; d = d>>1; } cout<<endl; } int main() { unsigned short int k; for(k = 0; k!=1024;k++) { if(hasOnlySix(k)) writeDays(k); } return 0; }
Standard input is empty
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