import sys
for k in sys.stdin:
x,y = k.split()
x,y,t = int(x),int(y),0
for i in range(x,y+1):
n = len(str(i))
sum1 = 0
for j in range(n):
sum1+=(int((str(i))[j])**n)
if int(sum1) == int(i):
print(sum1,end=' ')
t =1
print()
if t !=1:
print("none")
以上是參考,若有高手有更簡潔的方法還請賜教~(不要窮舉QQ)