Commit cb2fe14a authored by Romain's avatar Romain

fin

parent bd6475e2
Pipeline #250 failed with stages
......@@ -44,17 +44,18 @@ public class AssessmentPartOne {
int sumOfSquares = 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
{
sumOfSquares=-1;
sumOfSquares=-1;
}
return sumOfSquares;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment