fork download
  1. class Ideone
  2. {
  3. public static void main (String[] args) {
  4. System.out.println(days()[dow(8,10,2015)]);
  5. }
  6. public static String[] days() {
  7. return new String[] {
  8. "Sunday", "Monday", "Tuesday", "Wednesday",
  9. "Thursday", "Friday", "Saturday"
  10. };
  11. }
  12. public static int dow(int d, int m, int y) {
  13. if (m < 3) {
  14. m += 12;
  15. y--;
  16. }
  17. return (d + (int)((m+1)*2.6) + y + (int)(y/4) + 6*(int)(y/100) + (int)(y/400) + 6) % 7;
  18. }
  19. }
Success #stdin #stdout 0.1s 320576KB
stdin
Standard input is empty
stdout
Thursday