Python循环1
为什么水仙花只显示一个for x in range(100,1000):
a=x//100
b=x//10%10
c=153%10
if a**3+b**3+c**3==x:
print(x)
c写错了,写成153%10了
for x in range(100, 1000):
a = x // 100
b = x // 10 % 10
c = x % 10
if a ** 3 + b ** 3 + c ** 3 == x:
print(x)
153
370
371
407
Process finished with exit code 0
c=x%10
页:
[1]