def shui(s):
s1=s//100
s2=(s//10)%10
s3=s%10
if s1**3+s2**3+s3**3 == s:
return 1
else:
return 0
for i in range(100,1000):
i = int(i)
if shui(i):
print(i)
来源:CSDN
作者:宇未空
链接:https://blog.csdn.net/weixin_43662112/article/details/104284314