From 72e018b066bd5cc3ce0181b43865a227e8b9b6ec Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Fri, 12 Apr 2024 20:22:01 +0200 Subject: Initial fork from H48 --- test/010_math_permsign/permsgn_tests.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 test/010_math_permsign/permsgn_tests.c (limited to 'test/010_math_permsign/permsgn_tests.c') 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 @@ +#include "../test.h" + +int permsign(uint8_t *, int); + +int main(void) { + char str[STRLENMAX]; + uint8_t a[100]; + int n, i, p; + + fgets(str, STRLENMAX, stdin); + n = atoi(str); + + for (i = 0; i < n; i++) { + fgets(str, STRLENMAX, stdin); + a[i] = atoi(str); + } + + p = permsign(a, n); + printf("%d\n", p); + + return 0; +} -- cgit v1.3