BC92 变种水仙花
思路:
step1:按照要求筛选;加入创立的列表内,按要求打印;
代码如下:
i = 10000
c = []
while i <= 99999:
if (int(str(i)[0]) * int(str(i)[1:])) + (int(str(i)[0:2]) * int(str(i)[2:])) + (int(str(i)[0:3]) * int(str(i)[3:])) + (int(str(i)[0:4]) * int(str(i)[4:])) == i:
c.append(i)
i += 1
for i in c:
print(i,end=' ')