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