diff options
author | Orangerot <purple@orangerot.dev> | 2022-12-17 01:16:18 +0100 |
---|---|---|
committer | Orangerot <purple@orangerot.dev> | 2022-12-17 01:16:18 +0100 |
commit | 6596b48113ced669b206d2e1f1e8ba6edcba88a2 (patch) | |
tree | 02c7d01783390862d989df6c91aff968e03dd415 /2022/day01/test.c |
adv2022 first 8 days
Diffstat (limited to '2022/day01/test.c')
-rw-r--r-- | 2022/day01/test.c | 13 |
1 files changed, 13 insertions, 0 deletions
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 <stdio.h> +#include <stdlib.h> + +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)); + } +} |