水仙花数

# for i in range(100,1000):
# if int(str(i)[0])**3+int(str(i)[1])**3+int(str(i)[2])**3==i:
# print(i)
# else:
# continue

for i in range(100,1000):
y1=0
for x in str(i):
x1=int(x)**3
y1=y1+x1
if y1==i:
print(i)
posted @ 2019-09-11 17:40  菜鸟阿呆  阅读(150)  评论(0编辑  收藏  举报