summaryrefslogtreecommitdiff
path: root/day1/exercise/arm.py
blob: a1c2b649d480fd325f2d6751cf2916f1755a0ecc (plain)
1
2
3
4
5
6
7
8
9
10
cubes = []
for i in range(10):
    cubes.append(i ** 3)

for i in range(100, 1000):
    ones = i % 10
    tens = (i / 10) % 10
    hundreds = (i / 100) % 10
    if i == cubes[ones] + cubes[tens] + cubes[hundreds]:
        print "Armstrong Number: ", i