summaryrefslogtreecommitdiff
path: root/total.c
diff options
context:
space:
mode:
Diffstat (limited to 'total.c')
-rw-r--r--total.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/total.c b/total.c
new file mode 100644
index 0000000..bfdd7d0
--- /dev/null
+++ b/total.c
@@ -0,0 +1,16 @@
+#include <stdio.h>
+
+int main(int argc, char*argv[])
+{
+ int tot=0;
+ char s[128];
+
+ gets(s);
+ while(!feof(stdin))
+ {
+ tot+=atoi(s);
+ gets(s);
+ }
+
+ printf("%d\n",tot);
+}