Package net.n1da.dev.euler
Class PE0019
- java.lang.Object
-
- net.n1da.dev.euler.core.Problem
-
- net.n1da.dev.euler.PE0019
-
- All Implemented Interfaces:
Solvable
public class PE0019 extends Problem
Solution for problem 19 "Counting Sundays" completed on Sat, 23 May 2015, 23:06.- Since:
- 23.05.2015 22:42:18
- Author:
- Nico Danneberg
- See Also:
- Problem @ Project Euler, Solution @ Ni-Da-Net
-
-
Field Summary
Fields Modifier and Type Field Description private int[]
DaysInMonth
Stores the number of days for every month.
-
Method Summary
Modifier and Type Method Description void
prepare()
Here theDaysInMonth
are initialized.java.lang.String
solve()
Starting at Monday, 1.1.1900 it runs a loop by incrementing the current day of month and weekday.-
Methods inherited from class net.n1da.dev.euler.core.Problem
finish, getResult, getRuntime, toString
-
-
-
-
Method Detail
-
prepare
public void prepare()
Here theDaysInMonth
are initialized.
-
solve
public java.lang.String solve()
Starting at Monday, 1.1.1900 it runs a loop by incrementing the current day of month and weekday. If weekday equals 6 (Sunday) and the day of month it the first, the day is counted.- Returns:
- the number of Sundays that are the 1st of a month
-
-