输出1000以内的水仙花数 逻辑非常简单就不介绍了 for i in range(100,999): x = int(i%10) y = int(i/10%10) z = int(i/100) if x**3 + y**3+ z**3 ==i: print(i)