fork download
  1. s=100
  2. h0=100
  3. for i in range(1,10):
  4. h1=h0/2
  5. s=s+2*h1
  6. h0=h1
  7. print("小球一共经过了%.2f米,第10次的高度%.2f米"%(s,h0))
Success #stdin #stdout 0.01s 7228KB
stdin
Standard input is empty
stdout
小球一共经过了294.00米,第10次的高度0.00米