blob: c95fa7c7e120620543a8e27f843828445efde429 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
#include <stdio.h>
int main()
{
FILE *fi = fopen("INP.TXT", "r"), *fo = fopen("OUT.TXT", "w");
short n, i, a, b[10000] = {};
char m;
fscanf(fi, "%hd %hhd", &n, &m);
for (i = 0; i < n; i++) {
fscanf(fi, "%hd", &a);
fprintf(fo, "%hd ", ++b[a - 1]);
}
fputc(10, fo);
fcloseall();
return 0;
}
|