Solutions to problems 3 and 9 in C/C++.

The solution for problem 3 is quick in coming across the answer, but does not finish with it in a reasonable time.