author | Madhusudan.C.S <madhusudancs@gmail.com> |
Fri, 14 Aug 2009 11:07:24 +0530 | |
changeset 49 | 33c54f815fd5 |
parent 8 | 294ff7ac9cb6 |
permissions | -rwxr-xr-x |
8
294ff7ac9cb6
Added new set of files.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff
changeset
|
1 |
for i in range(100, 1000): |
294ff7ac9cb6
Added new set of files.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff
changeset
|
2 |
a = i % 10 |
294ff7ac9cb6
Added new set of files.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff
changeset
|
3 |
b = (i / 10) % 10 |
294ff7ac9cb6
Added new set of files.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff
changeset
|
4 |
c = (i / 100) % 10 |
294ff7ac9cb6
Added new set of files.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff
changeset
|
5 |
if i == a ** 3 + b ** 3 + c ** 3: |
294ff7ac9cb6
Added new set of files.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff
changeset
|
6 |
print "Armstrong Number: ", i |