diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2024-04-12 20:22:01 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2024-04-12 20:22:01 +0200 |
| commit | 72e018b066bd5cc3ce0181b43865a227e8b9b6ec (patch) | |
| tree | 60b2e8dbe7fd2dd7cf58ecd1606e03146329b516 /test/010_math_permsign/permsgn_tests.c | |
| download | cubecore-72e018b066bd5cc3ce0181b43865a227e8b9b6ec.tar.gz cubecore-72e018b066bd5cc3ce0181b43865a227e8b9b6ec.zip | |
Initial fork from H48
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 | } | ||
