mirror of
https://gitlab.gwdg.de/j.hahn02/university.git
synced 2026-01-01 14:54:25 -05:00
cleanup
This commit is contained in:
12
S1/GdCP/days.c
Normal file
12
S1/GdCP/days.c
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user