aboutsummaryrefslogtreecommitdiff
path: root/test/014_math_sumzerotodigits/sumzerotodigits.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/014_math_sumzerotodigits/sumzerotodigits.c')
-rw-r--r--test/014_math_sumzerotodigits/sumzerotodigits.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/014_math_sumzerotodigits/sumzerotodigits.c b/test/014_math_sumzerotodigits/sumzerotodigits.c
new file mode 100644
index 0000000..5bea7ca
--- /dev/null
+++ b/test/014_math_sumzerotodigits/sumzerotodigits.c
@@ -0,0 +1,21 @@
1#include "../test.h"
2
3void sumzerotodigits(int64_t, uint8_t, uint8_t, uint8_t *);
4
5void run(void) {
6 char str[STRLENMAX];
7 uint8_t i, n, b, a[100];
8 int64_t d;
9
10 fgets(str, STRLENMAX, stdin);
11 n = atoi(str);
12 fgets(str, STRLENMAX, stdin);
13 b = atoi(str);
14 fgets(str, STRLENMAX, stdin);
15 d = atoll(str);
16
17 sumzerotodigits(d, n, b, a);
18
19 for (i = 0; i < n; i++)
20 printf("%" PRIu8 "\n", a[i]);
21}

Generated with cgit - Back to sebastiano.tronto.net