Updated some results to be neater

This commit is contained in:
2020-08-28 11:05:09 -04:00
parent c40e1be88d
commit ea67dd3364
4 changed files with 4 additions and 4 deletions

View File

@@ -106,7 +106,7 @@ public class Problem14 extends Problem{
if(!solved){
throw new Unsolved();
}
return String.format("The number %d produced a chain of %d steps\n", maxNum, maxLength);
return String.format("The number %d produced a chain of %d steps", maxNum, maxLength);
}
//Returns the length of the requested chain
public long getLength(){

View File

@@ -85,7 +85,7 @@ public class Problem16 extends Problem{
if(!solved){
throw new Unsolved();
}
return String.format("%d^%d = %s\nThe sum of the elements is %d\n", NUM_TO_POWER, POWER, num.toString(), sumOfElements);
return String.format("%d^%d = %s\nThe sum of the elements is %d", NUM_TO_POWER, POWER, num.toString(), sumOfElements);
}
//Returns the number that was calculated
public BigInteger getNumber(){

View File

@@ -184,7 +184,7 @@ public class Problem17 extends Problem{
if(!solved){
throw new Unsolved();
}
return String.format("The sum of all the letters in all the numbers %d-%d is %d\n", START_NUM, STOP_NUM, letterCount);
return String.format("The sum of all the letters in all the numbers %d-%d is %d", START_NUM, STOP_NUM, letterCount);
}
//Returns the number of letters asked for
public long getLetterCount(){

View File

@@ -105,7 +105,7 @@ public class Problem8 extends Problem{
if(!solved){
throw new Unsolved();
}
return String.format("The greatest product is %d\nThe numbers are %d", maxProduct, maxNums);
return String.format("The greatest product is %d\nThe numbers are %s", maxProduct, maxNums);
}
//Returns the string of numbers that produces the largest product
public String getLargestNums(){