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