indextoperm_tests.c (325B)
1 #include "../test.h" 2 3 void indextoperm(int64_t, int64_t, uint8_t *); 4 5 void run(void) { 6 char str[STRLENMAX]; 7 uint8_t a[100]; 8 int64_t n, p, i; 9 10 fgets(str, STRLENMAX, stdin); 11 n = atoll(str); 12 fgets(str, STRLENMAX, stdin); 13 p = atoll(str); 14 15 indextoperm(p, n, a); 16 17 for (i = 0; i < n; i++) 18 printf("%" PRIu8 "\n", a[i]); 19 }