diff options
Diffstat (limited to 'test/010_math_permsign/permsgn_tests.c')
| -rw-r--r-- | test/010_math_permsign/permsgn_tests.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/010_math_permsign/permsgn_tests.c b/test/010_math_permsign/permsgn_tests.c new file mode 100644 index 0000000..46c7377 --- /dev/null +++ b/test/010_math_permsign/permsgn_tests.c | |||
| @@ -0,0 +1,22 @@ | |||
| 1 | #include "../test.h" | ||
| 2 | |||
| 3 | int permsign(uint8_t *, int); | ||
| 4 | |||
| 5 | int main(void) { | ||
| 6 | char str[STRLENMAX]; | ||
| 7 | uint8_t a[100]; | ||
| 8 | int n, i, p; | ||
| 9 | |||
| 10 | fgets(str, STRLENMAX, stdin); | ||
| 11 | n = atoi(str); | ||
| 12 | |||
| 13 | for (i = 0; i < n; i++) { | ||
| 14 | fgets(str, STRLENMAX, stdin); | ||
| 15 | a[i] = atoi(str); | ||
| 16 | } | ||
| 17 | |||
| 18 | p = permsign(a, n); | ||
| 19 | printf("%d\n", p); | ||
| 20 | |||
| 21 | return 0; | ||
| 22 | } | ||
