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.
Day of the Programmer
Day of the Programmer
Sort by
recency
|
1445 Discussions
|
Please Login in order to post a comment
By using java
public static String dayOfProgrammer(int year) { // Write your code here
TS
php solution
another c++ sol:
string dayOfProgrammer(int year) { int d=0; int m=0; int y=year; if(y<1918) { if(y%4==0) { return ("12.09."+to_string(y)); } else { return("13.09."+to_string(y)); } } else if(y>1918) { if(y%400==0 || (y%4==0&&y%100!=0)) { return("12.09."+to_string(y)); } else{ return("13.09."+to_string(y)); }
} else{ return("26.09."+to_string(y)); } return "0"; }