/* * Traditional implementation of leap year evaluation.
*/ staticbool is_leap(long year)
{ return year % 4 == 0 && (year % 100 != 0 || year % 400 == 0);
}
/* * Gets the last day of a month.
*/ staticint last_day_of_month(long year, int month)
{ if (month == 2) return 28 + is_leap(year); if (month == 4 || month == 6 || month == 9 || month == 11) return 30; return 31;
}
/* * Advances a date by one day.
*/ staticvoid advance_date(long *year, int *month, int *mday, int *yday)
{ if (*mday != last_day_of_month(*year, *month)) {
++*mday;
++*yday; return;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.