From 6596b48113ced669b206d2e1f1e8ba6edcba88a2 Mon Sep 17 00:00:00 2001 From: Orangerot Date: Sat, 17 Dec 2022 01:16:18 +0100 Subject: adv2022 first 8 days --- 2022/day01/test.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 2022/day01/test.c (limited to '2022/day01/test.c') diff --git a/2022/day01/test.c b/2022/day01/test.c new file mode 100644 index 0000000..bb48b4c --- /dev/null +++ b/2022/day01/test.c @@ -0,0 +1,13 @@ +#include +#include + +int main() +{ + int i; + char *line = NULL; + size_t len = 0; + while (getline(&line, &len, stdin) >= 0) { + if ( line[0] == '\n' ) printf("newline\n"); + printf("%d\n", atoi(line)); + } +} -- cgit v1.2.3