my c++ solutions to some math problems