fork(1) download
  1. cont = 0
  2. n = 0
  3. total = 0
  4. while True:
  5. n = int(input("Digite 999 para parar"))
  6. if n == 999: break
  7. cont += 1
  8. total += n
  9. print(total)
  10.  
  11. #https://pt.stackoverflow.com/q/350241/101
Success #stdin #stdout 0.02s 27712KB
stdin
1
2
999
stdout
Digite 999 para pararDigite 999 para pararDigite 999 para parar3