Added C++ and Java projects for problem 118