大神们,我的代码也没有错误吧?只不过我理解的是x=x^(n-1)
sum = 0
x = 1
n = 1
while True:
sum=sum+x
n=n+1
x=x^(n-1)
if n>20:
break
print sum
sum = 0
x = 1
n = 1
while True:
sum=sum+x
n=n+1
x=x^(n-1)
if n>20:
break
print sum
2019-12-04
举报