Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
Assessment YSJ
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
romain.vasseur
Assessment YSJ
Commits
cb2fe14a
Commit
cb2fe14a
authored
Nov 07, 2018
by
Romain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fin
parent
bd6475e2
Pipeline
#250
failed with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
AssessmentPartOne.java
src/AssessmentPartOne.java
+5
-4
No files found.
src/AssessmentPartOne.java
View file @
cb2fe14a
...
@@ -44,17 +44,18 @@ public class AssessmentPartOne {
...
@@ -44,17 +44,18 @@ public class AssessmentPartOne {
int
sumOfSquares
=
0
;
int
sumOfSquares
=
0
;
if
(
start
+
1
<
end
&&
start
>=
0
)
if
(
start
+
1
<
end
&&
start
>=
0
)
// start+1<end to avoid no number between start and end
//start must be positive or = 0 to go into the loop
{
{
for
(
int
i
=
start
+
1
;
i
<
end
;
i
++)
// loop i=start+1 because start is not included and i<end because we add the last number before end
for
(
int
i
=
start
+
1
;
i
<
end
;
i
++)
// loop i=start+1 because start is not included and i<end because we add
until
the last number before end
{
{
sumOfSquares
=
sumOfSquares
+
i
;
sumOfSquares
=
sumOfSquares
+
i
;
// sumOfSquares= add each i at itself
}
}
}
else
}
else
{
{
sumOfSquares
=-
1
;
sumOfSquares
=-
1
;
}
}
return
sumOfSquares
;
return
sumOfSquares
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment