day1/exercise/arm.py
changeset 64 333092b68926
child 425 5afcfce15e71
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/day1/exercise/arm.py	Thu Oct 08 18:59:47 2009 +0530
@@ -0,0 +1,10 @@
+cubes = []
+for i in range(10):
+    cubes.append(i ** 3)
+
+for i in range(100, 1000):
+    a = i % 10
+    b = (i / 10) % 10
+    c = (i / 100) % 10
+    if i == cubes[a] + cubes[b] + cubes[c]:
+        print "Armstrong Number: ", i