about summary refs log tree commit diff
path: root/others/easy20160714/02.c
diff options
context:
space:
mode:
Diffstat (limited to 'others/easy20160714/02.c')
-rw-r--r--others/easy20160714/02.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/others/easy20160714/02.c b/others/easy20160714/02.c
new file mode 100644
index 0000000..eef5264
--- /dev/null
+++ b/others/easy20160714/02.c
@@ -0,0 +1,25 @@
+#include <stdio.h>
+
+int main()
+{
+	FILE *f = fopen("INP.TXT", "r");
+	char n;
+	short a, tmp = -1;
+
+	fscanf(f, "%hhd", &n);
+
+	for (; n; n--) {
+		fscanf(f, "%hd", &a);
+		tmp = (a > tmp && a % 2 == 0) ? a : tmp;
+	}
+
+	fclose(f);
+
+	f = fopen("OUT.TXT", "w");
+
+	fprintf(f, "%hd\n", tmp);
+
+	fclose(f);
+
+	return 0;
+}