print('所有的水仙花数为:')
for each in range(100,1000):
temp= each
sum = 0
while temp:
sum = sum + (temp % 10) ** 3
temp = temp // 10
if sum == each:
print(each,end='\t')
Python 水仙花数
最新推荐文章于 2020-06-04 20:43:25 发布