Given the date string "March 7 2009 7:30pm EST", output the time 12 hours later in any human-readable format. #include <string> #include &
Continue ReadingC++: Flipping Bits Game
The game Given an N by N square array of zeroes or ones in an initial configuration, and a target configuration of zeroes and ones The task
Continue ReadingC++: Monty Hall Problem
Run random simulations of the Monty Hall game. Show the effects of a strategy of the contestant always keeping his first guess so it can be contrasted
Continue ReadingC++: N-Queens Problem
Solve the eight queens puzzle. You can extend the problem to solve the puzzle with a board of side NxN. For the number of solutions for small value
Continue ReadingC++: FizzBuzz
Write a program that prints the integers from 1 to 100. But for multiples of three print "Fizz" instead of the number, and for the multiples of fiv
Continue ReadingC++: Generator
A generator is an executable entity (like a function or procedure) that contains code that yields a sequence of values, one at a time, so that each ti
Continue ReadingC++: Flatten a List
Write a function to flatten the nesting in an arbitrary list of values. Your program should work on the equivalent of this list: [[1], 2, [[3,4], 5
Continue ReadingC++: ABC Problem
You are given a collection of ABC blocks. Just like the ones you had when you were a kid. There are twenty blocks with two letters on each block. You
Continue ReadingC++: Date Format
Display the current date in the formats of "2007-11-10" and "Sunday, November 10, 2007". // Display the current date in the formats of "2007-11-1
Continue ReadingC++: Langton’s Ant
Langton's ant is a cellular automaton that models an ant sitting on a plane of cells, all of which are white initially, facing in one of four directio
Continue Reading