summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcumulate15
1 files changed, 15 insertions, 0 deletions
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)
+
contact: Jan Huwald // Impressum