Added day 1 part 1 (C)
This commit is contained in:
parent
f176e9b272
commit
35764c7746
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user