Solve problem 42 in C++
Solve problem 28
Solve problem 36