我这个为结果是119
sum = 0
x = 1
n = 1
while True:
sum=sum+x
n=n+1
x=2^(n-1)
if x>2^19:
break
print sum
119
sum = 0
x = 1
n = 1
while True:
sum=sum+x
n=n+1
x=2^(n-1)
if x>2^19:
break
print sum
119
2019-07-03
举报