diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2024-07-04 17:09:55 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2024-07-04 17:09:55 +0200 |
| commit | 518d98ad5f9eec0cf4124375bdbb84d1296b3f3f (patch) | |
| tree | 467b2b0387f23a0b379cf428c6883937ec18c134 /test/012_math_permsign/permsign_tests.c | |
| parent | 425eee24421bf0a19c7e0199d2e3ecba3318c8f4 (diff) | |
| download | nissy-core-518d98ad5f9eec0cf4124375bdbb84d1296b3f3f.tar.gz nissy-core-518d98ad5f9eec0cf4124375bdbb84d1296b3f3f.zip | |
(almost) added getcube
Diffstat (limited to 'test/012_math_permsign/permsign_tests.c')
| -rw-r--r-- | test/012_math_permsign/permsign_tests.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/012_math_permsign/permsign_tests.c b/test/012_math_permsign/permsign_tests.c new file mode 100644 index 0000000..fa8ce9b --- /dev/null +++ b/test/012_math_permsign/permsign_tests.c | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | #include "../test.h" | ||
| 2 | |||
| 3 | int permsign(uint8_t *, int64_t); | ||
| 4 | |||
| 5 | void run(void) { | ||
| 6 | char str[STRLENMAX]; | ||
| 7 | uint8_t a[100]; | ||
| 8 | int p; | ||
| 9 | int64_t n, i; | ||
| 10 | |||
| 11 | fgets(str, STRLENMAX, stdin); | ||
| 12 | n = atoll(str); | ||
| 13 | |||
| 14 | for (i = 0; i < n; i++) { | ||
| 15 | fgets(str, STRLENMAX, stdin); | ||
| 16 | a[i] = atoi(str); | ||
| 17 | } | ||
| 18 | |||
| 19 | p = permsign(a, n); | ||
| 20 | printf("%d\n", p); | ||
| 21 | } | ||
