+ 1
Gregorian Calendar
Hi guys I have problem in making a calendar that gets some number and add them to a date For example My date is 4/5/2020 And I want to for example add200 days in that date Would you please suggest a syntax for it in c++?
2 ответов
0
Hi Mike
The main considerations here are representing a date as the nth day of a year, and the opposite: converting the nth day of a year to a date.
https://stackoverflow.com/a/13242847
Try using the logic from this answer for your problem. It doesn't account for leap years though.
If you're stuck, look at the solution I just uploaded. I think there's no bugs but let me know if there's anything https://code.sololearn.com/czXevRSXD2di
+ 1
Thanks Zena
Your code was helpful