From 3ce4b80aca1dd238f00cbedfd7ef015842f6ca9f Mon Sep 17 00:00:00 2001 From: Jan Huwald Date: Thu, 31 Jan 2013 12:05:32 +0100 Subject: add cumulate diff --git a/cumulate b/cumulate new file mode 100755 index 0000000..1ec3b4d --- /dev/null +++ b/cumulate @@ -0,0 +1,15 @@ +#!/usr/bin/python + +import sys + +total=0 +while 1: + try: + line = sys.stdin.readline() + if not line: + break + total += int(line) + print total + except: + sys.exit(1) + -- cgit v0.10.1