mirror of
https://gitlab.gwdg.de/j.hahn02/university.git
synced 2026-01-01 06:44:25 -05:00
13 lines
322 B
C
13 lines
322 B
C
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;
|
|
}
|