x=int(input())suma=0while x!=0: if x>0: suma+=x x=int(input())print(suma)
-10 15 20 0
35
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!