c++ code for solutions of <<cc150>>