Solving Project Euler by using C++