Counts digits in different bases // For instance 232223 has 4 2's in base 10, 15 has 4 1's in base 2 #include using namespace std; //This should return the number of 1's in the binary representation //of the input number (in decimal) int CountBinOnes(int dec_number) { //base case //recursive case } //This should return the number of 'digits' in the 'base' representation //of the input number (in decimal) //This only has to work for bases between 2-10 and digits 0-9 int CountBaseDigits(int dec_number, int base, int digit) { //base case //recursive case } //This should display the number in the 'base' representation void PrintBaseDigits(int dec_number, int base) { } //a shortcut function to do error checking and ensure we have an integer void GetInput(int &input) { //get inputs cin >> input; while( !cin ) { cin.clear(); cin.ignore(2000, '\n'); cout
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
27 | 28 | 29 | 30 | 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |