#方法1:
import math
for n in range(100,1000):
i = math.floor(n/100)
j = math.floor(n/10-i*10)
k = n%10
total = pow(i,3) + pow(j,3) + pow(k,3)
if n == total:
print("水仙花数是:",n)
#方法2:
for a in range(1,10):
for b in range(10):
for c in range(10):
s1= a*100+b*10+c
s2= pow(a,3)+pow(b,3)+pow(c,3)
if s1==s2:
print(s1, "是水仙花数")