The solutions coded in C++