c++ solutions