We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
publicstaticstringdayOfProgrammer(intyear){if(year<=1917){// julian calendarif(year%4==0){return("12.09."+year);}else{return("13.09."+year);}}elseif(year>=1919){// gregor calendarif(year%400==0||(year%4==0&&year%100!=0)){return("12.09."+year);}else{return("13.09."+year);}}else{// special case of transition year 1918return("26.09."+year);}
Cookie support is required to access HackerRank
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 →
Solution in C#: