about summary refs log tree commit diff
path: root/others/easy20160714/02.c
blob: eef5264fe71390dcb6ddc8fafc23e97c8c724c94 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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;
}