added cpp solution to problem #14