part one day one

This commit is contained in:
blackbeard420 2021-12-04 14:23:24 -05:00
commit 1e57445312
Signed by: blackbeard420
GPG Key ID: 88C719E09CDDA4A5
2 changed files with 2026 additions and 0 deletions

2000
01/input Normal file

File diff suppressed because it is too large Load Diff

26
01/main.c Normal file
View File

@ -0,0 +1,26 @@
#include <stdlib.h>
#include <stdio.h>
int
main()
{
int prev = -1;
int total = 0;
static char buffer[1024];
FILE *f = fopen("input", "r");
while(fgets(buffer, 1024, f)) {
int val = atoi(buffer);
if(prev != -1 && val > prev) {
total++;
}
prev = val;
}
printf("total increasing: %d\n", total);
fclose(f);
return 0;
}