advent-of-code/01/day1.c
2018-12-01 17:53:35 +01:00

18 lines
287 B
C

#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;
}