FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
ProjectEuler-Java/Sol16.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
/
Sol16.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
13 lines (11 loc) · 370 Bytes
Breadcrumbs
ProjectEuler-Java
/
Sol16.java
Copy path
File metadata and controls
13 lines (11 loc) · 370 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
import
java
.
math
.*;
public
class
Sol16
extends
BaseSolution
{
public
void
runSolution
() {
String
digits
=
new
BigInteger
(
"2"
).
pow
(
1000
).
toString
();
int
sum
=
0
;
for
(
int
i
=
0
;
i
<
digits
.
length
();
i
++) {
sum
+=
Integer
.
parseInt
(
new
Character
(
digits
.
charAt
(
i
)).
toString
());
}
System
.
out
.
println
(
sum
);
}
}
Back
|
FazBrowse Home
|
New Git URL