aboutsummaryrefslogtreecommitdiff
path: root/test/011_math_indextoperm/indextoperm_tests.c
blob: 87399ef43e00f9fbad3aa6e77908f21af6562906 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include "../test.h"

void indextoperm(int64_t, size_t n, uint8_t [n]);

void run(void) {
	char str[STRLENMAX];
	uint8_t a[100];
	int64_t n, p, i;

	fgets(str, STRLENMAX, stdin);
	n = atoll(str);
	fgets(str, STRLENMAX, stdin);
	p = atoll(str);

	indextoperm(p, n, a);

	for (i = 0; i < n; i++)
		printf("%" PRIu8 "\n", a[i]);
}

Generated with cgit - Back to sebastiano.tronto.net