about summary refs log tree commit diff
path: root/others/easy20160714/10.c
diff options
context:
space:
mode:
Diffstat (limited to 'others/easy20160714/10.c')
-rw-r--r--others/easy20160714/10.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/others/easy20160714/10.c b/others/easy20160714/10.c
new file mode 100644
index 0000000..fefd6d3
--- /dev/null
+++ b/others/easy20160714/10.c
@@ -0,0 +1,40 @@
+#include <stdio.h>
+
+int main()
+{
+	FILE *f = fopen("INP.TXT", "r");
+	unsigned long long n;
+	long long a, b, c;
+	char s[5] = {89, 69, 83, 10};
+
+	fscanf(f, "%lld", &n);
+
+	if (n > 2) {
+		fscanf(f, "%lld %lld", &a, &b);
+		c = b - a;
+
+		for (n -= 2; n; n--) {
+			a = b;
+			fscanf(f, "%lld", &b);
+
+			if (a - b + c) {
+				s[0] = 78;
+				s[1] = 79;
+				s[2] = 10;
+				s[3] = 0;
+
+				break;
+			}
+		}
+	}
+
+	fclose(f);
+
+	f = fopen("OUT.TXT", "w");
+
+	fputs(s, f);
+
+	fclose(f);
+
+	return 0;
+}