summaryrefslogtreecommitdiff
path: root/total.c
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2007-03-04 18:35:36 +0000
committerIan C <ianc@noddybox.co.uk>2007-03-04 18:35:36 +0000
commit954af9179665457b40453a0417ddf5b3949a0449 (patch)
treee3772817de5c79e29b602ebe47fe0129793f1470 /total.c
parent892e6e107dbf2386831bd00e7f1c2a0bbe8b2cbb (diff)
This commit was generated by cvs2svn to compensate for changes in r2,
which included commits to RCS files with non-trunk default branches.
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);
+}