2
1
Fork 0

Day 1: Add C solution part 1

This commit is contained in:
Mia Herkt 2021-12-01 10:10:04 +01:00
parent ff394a0c23
commit eb2817eec9
Signed by: mia
GPG key ID: 72E154B8622EC191
2 changed files with 15 additions and 0 deletions

1
01/input.h Normal file

File diff suppressed because one or more lines are too long

14
01/solution.c Normal file
View file

@ -0,0 +1,14 @@
#include <stdio.h>
#include <stdint.h>
#include "input.h"
int main(void) {
uint16_t answer = 0;
for (uint16_t *p = input+1; p < (&input)[1]; p++) {
if (*p > *(p-1))
answer++;
}
printf("Answer: %d\n", answer);
}