题解 | #变种水仙花#
变种水仙花
http://www.nowcoder.com/practice/c178e3f5cc4641dfbc8b020ae79e2b71
不会写切片的我=。=
for i in range(10000,100000):
lis = list(str(i))
a = int(lis[0])*int(lis[1]+lis[2]+lis[3]+lis[4])
b = int(lis[0]+lis[1])*int(lis[2]+lis[3]+lis[4])
c = int(lis[0]+lis[1]+lis[2])*int(lis[3]+lis[4])
d = int(lis[0]+lis[1]+lis[2]+lis[3])*int(lis[4])
if i == a+b+c+d:
print(i,end = ' ')