fork(1) download
  1. #!/usr/bin/env python3
  2. import sys
  3.  
  4. partial_sum = 0
  5. for n in map(int, sys.stdin):
  6. partial_sum += n
  7. print(partial_sum)
Success #stdin #stdout 0.01s 9992KB
stdin
3
4
5
8
stdout
3
7
12
20