FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
ProjectEuler-Java/Sol2.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
/
Sol2.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
17 lines (16 loc) · 432 Bytes
Breadcrumbs
ProjectEuler-Java
/
Sol2.java
Copy path
File metadata and controls
17 lines (16 loc) · 432 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
public
class
Sol2
extends
BaseSolution
{
public
void
runSolution
() {
int
sum
=
0
;
int
prev1
=
0
,
prev2
=
1
;
for
(
int
i
=
0
; ;
i
++) {
int
savePrev1
=
prev1
;
prev1
=
prev2
;
prev2
=
savePrev1
+
prev2
;
if
(
prev1
>=
4000000
)
break
;
if
(
prev1
%
2
==
0
)
sum
+=
prev1
;
}
System
.
out
.
println
(
sum
);
}
}
Back
|
FazBrowse Home
|
New Git URL