refactor various files

This commit is contained in:
2025-04-28 16:59:44 +02:00
parent 5049c3ec13
commit 05c830c8e2
97 changed files with 513 additions and 2676 deletions

31
S1/GdCP/uebung/aoc18.c Normal file
View File

@@ -0,0 +1,31 @@
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
void mix(long *n, long r) { *n = *n ^ r; }
void prune(long *n) { *n = *n % 16777216; }
int main() {
FILE *file = fopen("18.in", "r");
if (!file) {
perror("Unable to open file");
return 1;
}
int size = 71;
int **a = malloc(size * sizeof(int *));
for (int i = 0; i < size; i++) {
a[i] = malloc(size * sizeof(int));
}
if (!a) {
perror("Memory allocation failed");
fclose(file);
return 1;
}
fclose(file);
free(a);
return 0;
}