Added day 1 part 1 (C)

This commit is contained in:
kageru 2018-12-01 17:53:35 +01:00
parent f176e9b272
commit 35764c7746
2 changed files with 1040 additions and 0 deletions

17
01/day1.c Normal file
View File

@ -0,0 +1,17 @@
#include <stdio.h>
#include <stdlib.h>
int main() {
int position = 0;
FILE* inputFile = fopen("input", "r");
char line [10];
while (fgets(line, sizeof(line), inputFile)) {
position += strtol(line, NULL, 10);
}
printf("%d", position);
return 0;
}

1023
01/input Normal file

File diff suppressed because it is too large Load Diff