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

12
S1/GdCP/uebung/days.c Normal file
View File

@@ -0,0 +1,12 @@
int months[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int datum2int(int tag, int monat) {
for (int i = 0; i < monat - 1; tag += months[i++]);
return tag;
}
void int2datum(int tage, int *ergebnis) {
int m = 0;
for (; tage > months[m]; tage -= months[m++]);
ergebnis[0] = tage; ergebnis[1] = m+1;
}