aboutsummaryrefslogtreecommitdiff
path: root/test/014_math_sumzerotodigits/sumzerotodigits.c
blob: e8d2814cebe612f0bb36c02d889986c09d210059 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "../test.h"

void sumzerotodigits(uint64_t, size_t n, uint8_t, uint8_t [n]);

void run(void) {
	char str[STRLENMAX];
	uint8_t i, n, b, a[100];
	uint64_t d;

	fgets(str, STRLENMAX, stdin);
	n = atoi(str);
	fgets(str, STRLENMAX, stdin);
	b = atoi(str);
	fgets(str, STRLENMAX, stdin);
	d = atoll(str);

	sumzerotodigits(d, n, b, a);
	
	for (i = 0; i < n; i++)
		printf("%" PRIu8 "\n", a[i]);
}

Generated with cgit - Back to sebastiano.tronto.net