about summary refs log tree commit diff
path: root/others/easy20160714/12.c
blob: f8a71d3783c685695efc90527d18abcb3ddc9eb3 (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
26
27
28
#include <stdio.h>

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;
}