题解 | #变种水仙花#
变种水仙花
https://www.nowcoder.com/practice/c178e3f5cc4641dfbc8b020ae79e2b71
for i in range(10000,100000): sum = 0 i = str(i) for j in range(4): a,b = i[:j+1],i[j+1:] sum += int(a)*int(b) if sum == int(i): print(i,end=' ')#题解#
变种水仙花
https://www.nowcoder.com/practice/c178e3f5cc4641dfbc8b020ae79e2b71
for i in range(10000,100000): sum = 0 i = str(i) for j in range(4): a,b = i[:j+1],i[j+1:] sum += int(a)*int(b) if sum == int(i): print(i,end=' ')#题解#
相关推荐