fork download
  1. N = int(input())
  2. A = [0] * N
  3. S = 0
  4.  
  5. for i in range(N):
  6. A[i] = int(input())
  7.  
  8. for i in range(N):
  9. if A[i] > 0:
  10. S += A[i]
  11.  
  12. print(S)
Success #stdin #stdout 0.03s 9440KB
stdin
5
1
-2
6
-9
10
stdout
17