Fixed typo

This commit is contained in:
2020-10-26 12:00:27 -04:00
parent a6aceb9e42
commit 2f8d94de29

View File

@@ -51,7 +51,7 @@ public class Problem5 extends Problem{
//Start at 20 because it must at least be divisible by 20. Increment by 2 because it must be an even number to be divisible by 2
boolean numFound = false; //A flag for finding the divisible number
int currentNum = 20; //The number that it are currently checking against
int currentNum = 20; //The number that it is currently checking against
while((currentNum > 0) && (!numFound)){
//Start by assuming you found the number (because we throw a flag if we didn't find it)
numFound = true;
@@ -90,7 +90,7 @@ public class Problem5 extends Problem{
if(!solved){
throw new Unsolved();
}
return String.format("The smallest positive number evenly divisible by all numbers 1-20 is " + smallestNum);
return String.format("The smallest positive number evenly divisible by all numbers 1-20 is %d", smallestNum);
}
//Returns the requested number
public int getNumber(){
@@ -103,6 +103,6 @@ public class Problem5 extends Problem{
}
/* Results:
The smallest positive number evenly divisibly by all number 1-20 is 232792560
It took an average of 280.352 milliseconds to run this problem through 100 iterations
The smallest positive number evenly divisible by all numbers 1-20 is 232792560
It took an average of 213.942 milliseconds to run this problem through 100 iterations
*/