summaryrefslogtreecommitdiff
path: root/1.c
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2021-12-09 13:32:48 +0000
committerIan C <ianc@noddybox.co.uk>2021-12-09 13:32:48 +0000
commit8833b7a5b246cad02e253838c07ba1689834e523 (patch)
treede8ae5cbb97a802a7d2ce30e7db37798ac02be00 /1.c
Initial checkin
Diffstat (limited to '1.c')
-rw-r--r--1.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/1.c b/1.c
new file mode 100644
index 0000000..7041065
--- /dev/null
+++ b/1.c
@@ -0,0 +1,26 @@
+#include <stdlib.h>
+#include <stdio.h>
+
+int main(void)
+{
+ char buff[80];
+ int last = -1;
+ int count = 0;
+
+ while(fgets(buff, sizeof buff, stdin))
+ {
+ int i = atoi(buff);
+
+ if (last != -1 && last < i)
+ {
+ printf("%d\n", i);
+ count++;
+ }
+
+ last = i;
+ }
+
+ printf("count=%d\n", count);
+
+ return 0;
+}