Home Project Euler Teaching Projects Gallery

Problem 13: Large sum

Problem statement


Algorthim:

It's a bit pointless to copy and paste 100 50-digit number onto the web page.. Regardless..

Looks like since the number was big (50-digit), I divided the digits into 5 different 10 digits:

$$ 1120481209 \quad 5812095812 \quad 8215801825 \quad 0923412498$$

I added numbers with each corresponding sections together and added the sections together taking into account of place-holders!

Code:

Result:

Answer: 5537376230
Runtime: 0.2 ms