aboutsummaryrefslogtreecommitdiff
path: root/test/011_math_indextoperm/indextoperm_tests.c
blob: cb1306d7c09a8d5cfd91c6f69bd9aa0699f73ac5 (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, int64_t, uint8_t *);

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