while 1:
num = input('请输入一个三位数:')
count = 0
if num.isdecimal() and 100 <= int(num) < 1000:
for i in num:
count = count + int(i) ** 3
if count == int(num):
print("{}是一个水仙花数".format(num))
else:
print("{}不是一个水仙花数".format(num))
else:
print('输入错误,请输入一个三位数')