C-solution to projecteuler.net problems