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