Created
May 16, 2016 20:52
-
-
Save rep-movsd/7a78a0cacf9823d27ad4c14c1dd2dfb9 to your computer and use it in GitHub Desktop.
DateToDay
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const int days[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; | |
int days_acc[13] = {0}; | |
partial_sum(days, days+12, days_acc+1); | |
int date2day(int m, int d) | |
{ | |
return days_acc[m] + d; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment