From 7206ecee7579a10dd347d06b397b3790e969f8f3 Mon Sep 17 00:00:00 2001 From: Raphael McSinyx Date: Sun, 1 Jan 2017 21:05:53 +0700 Subject: Add others/easy20160714 --- others/easy20160714/12.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 others/easy20160714/12.c (limited to 'others/easy20160714/12.c') diff --git a/others/easy20160714/12.c b/others/easy20160714/12.c new file mode 100644 index 0000000..f8a71d3 --- /dev/null +++ b/others/easy20160714/12.c @@ -0,0 +1,28 @@ +#include + +int main() +{ + FILE *f = fopen("INP.TXT", "r"); + short m, n, i, a; + char b[10000] = {}; + + fscanf(f, "%hd %hd", &n, &m); + for (i = 0; i < m; i++) { + fscanf(f, "%hd", &a); + b[a - 1] = 1; + } + + fclose(f); + + f = fopen("OUT.TXT", "w"); + fprintf(f, "%hd\n", n - m); + + for (i = 0; i < n; i++) + if (!b[i]) + fprintf(f, "%hd ", i + 1); + + fputc(10, f); + fclose(f); + + return 0; +} -- cgit 1.4.1