FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
ProjectEuler-Java/Sol19.java at master · JoshP/ProjectEuler-Java · GitHub
JoshP
ProjectEuler-Java
Repository navigation
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
ProjectEuler-Java
/
Sol19.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
18 lines (16 loc) · 525 Bytes
Breadcrumbs
ProjectEuler-Java
/
Sol19.java
Copy path
File metadata and controls
18 lines (16 loc) · 525 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import
java
.
util
.*;
public
class
Sol19
extends
BaseSolution
{
public
void
runSolution
() {
int
count
=
0
;
Calendar
cal
=
Calendar
.
getInstance
();
cal
.
set
(
1901
,
1
,
1
);
while
(
cal
.
get
(
Calendar
.
YEAR
) !=
2001
) {
if
(
cal
.
get
(
Calendar
.
DAY_OF_WEEK
) ==
Calendar
.
SUNDAY
&&
cal
.
get
(
Calendar
.
DAY_OF_MONTH
) ==
1
) {
count
++;
}
cal
.
add
(
Calendar
.
DAY_OF_MONTH
,
1
);
}
System
.
out
.
println
(
count
);
}
}
Back
|
FazBrowse Home
|
New Git URL