permsgn_tests.c (310B)
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 }