app/site-content/proposals/2009/07/28/arm.py
author Madhusudan.C.S <madhusudancs@gmail.com>
Thu, 06 Aug 2009 22:48:30 +0530
changeset 11 dfc069c2d35d
parent 0 c94bd9ae70d2
permissions -rwxr-xr-x
Added home.html
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
     1
for i in range(100, 1000):
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
     2
    a = i % 10
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
     3
    b = (i / 10) % 10
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
     4
    c = (i / 100) % 10
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
     5
    if i == a ** 3 + b ** 3 + c ** 3:
c94bd9ae70d2 First commit.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
     6
        print "Armstrong Number: ", i