From 518d98ad5f9eec0cf4124375bdbb84d1296b3f3f Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Thu, 4 Jul 2024 17:09:55 +0200 Subject: (almost) added getcube --- test/011_math_indextoperm/indextoperm_tests.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 test/011_math_indextoperm/indextoperm_tests.c (limited to 'test/011_math_indextoperm/indextoperm_tests.c') diff --git a/test/011_math_indextoperm/indextoperm_tests.c b/test/011_math_indextoperm/indextoperm_tests.c new file mode 100644 index 0000000..cb1306d --- /dev/null +++ b/test/011_math_indextoperm/indextoperm_tests.c @@ -0,0 +1,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]); +} -- cgit v1.3