You are viewing a single comment's thread. Return to all comments →
Good idea, but I think my solution is better and not much slower.
C++ sulition that can count any holyday, by changing 256 (day of holyday). It can be variable entered by input too, easy.
P.S. Well, at least holidays held in 9th month :D For ALL hilidays need to implement a way to count months too!
const int mon7 = 215; //7 months' days string solve(int year) { short int feb; //days in february if(year < 1918) //julian feb = year%4 ? 28 : 29; else if(year > 1918) //gregorian feb = !(year%400) || year%100&&!(year%4) ? 29 : 28; else //dreaded 1918 feb = 15; feb = 256 - (feb + mon7); return to_string(feb) + ".09." + to_string(year); }
Seems like cookies are disabled on this browser, please enable them to open this website
Day of the Programmer
You are viewing a single comment's thread. Return to all comments →
Good idea, but I think my solution is better and not much slower.
C++ sulition that can count any holyday, by changing 256 (day of holyday). It can be variable entered by input too, easy.
P.S. Well, at least holidays held in 9th month :D For ALL hilidays need to implement a way to count months too!