Fixed a few typoes

This commit is contained in:
2021-07-03 17:03:13 -04:00
parent 6de24c0680
commit c4434fec59
5 changed files with 11 additions and 8 deletions

View File

@@ -1,7 +1,7 @@
//ProjectEuler/ProjectEulerCPP/headers/Problems/Problem27.hpp //ProjectEuler/ProjectEulerCPP/headers/Problems/Problem27.hpp
//Matthew Ellison //Matthew Ellison
// Created: 09-14-19 // Created: 09-14-19
//Modified: 07-02-21 //Modified: 07-03-21
//Find the product of the coefficients, |a| < 1000 and |b| <= 1000, for the quadratic expression that produces the maximum number of primes for consecutive values of n, starting with n=0. //Find the product of the coefficients, |a| < 1000 and |b| <= 1000, for the quadratic expression that produces the maximum number of primes for consecutive values of n, starting with n=0.
//Unless otherwise listed all non-standard includes are my own creation and available from https://bibucket.org/Mattrixwv/myClasses //Unless otherwise listed all non-standard includes are my own creation and available from https://bibucket.org/Mattrixwv/myClasses
/* /*
@@ -49,6 +49,7 @@ public:
int64_t getTopA() const; //Returns the top A that was generated int64_t getTopA() const; //Returns the top A that was generated
int64_t getTopB() const; //Returns the top B that was generated int64_t getTopB() const; //Returns the top B that was generated
int64_t getTopN() const; //Returns the top N that was generated int64_t getTopN() const; //Returns the top N that was generated
int64_t getProduct() const; //Returns the product of A and B for the answer
}; };

View File

@@ -93,10 +93,7 @@ int64_t Problem12::getTriangularNumber() const{
} }
//Get the final number that was added to the triangular number //Get the final number that was added to the triangular number
int64_t Problem12::getLastNumberAdded() const{ int64_t Problem12::getLastNumberAdded() const{
//If the problem hasn't been solved throw an exception solvedCheck("last number added to get the triangular number");
if(!solved){
throw Unsolved("You must solve the problem before you can see the last number added to get the triangular number");
}
return counter - 1; return counter - 1;
} }
//Returns the list of divisors of the requested number //Returns the list of divisors of the requested number

View File

@@ -1,7 +1,7 @@
//ProjectEuler/ProjectEulerCPP/src/Problems/Problem27.cpp //ProjectEuler/ProjectEulerCPP/src/Problems/Problem27.cpp
//Matthew Ellison //Matthew Ellison
// Created: 09-14-19 // Created: 09-14-19
//Modified: 07-02-21 //Modified: 07-03-21
//Find the product of the coefficients, |a| < 1000 and |b| <= 1000, for the quadratic expression that produces the maximum number of primes for consecutive values of n, starting with n=0. //Find the product of the coefficients, |a| < 1000 and |b| <= 1000, for the quadratic expression that produces the maximum number of primes for consecutive values of n, starting with n=0.
//Unless otherwise listed all non-standard includes are my own creation and available from https://bibucket.org/Mattrixwv/myClasses //Unless otherwise listed all non-standard includes are my own creation and available from https://bibucket.org/Mattrixwv/myClasses
/* /*
@@ -106,3 +106,8 @@ int64_t Problem27::getTopN() const{
solvedCheck("largest N"); solvedCheck("largest N");
return topN; return topN;
} }
//Returns the product of A and B for the answer
int64_t Problem27::getProduct() const{
solvedCheck("product of A and B");
return topA * topB;
}

View File

@@ -118,7 +118,7 @@ std::vector<mpz_class> Problem29::getUnique() const{
solvedCheck("the unique values for a^b"); solvedCheck("the unique values for a^b");
return unique; return unique;
} }
//Returns the number of unique value for a^b //Returns the number of unique values for a^b
size_t Problem29::getNumUnique() const{ size_t Problem29::getNumUnique() const{
solvedCheck("the number of unique values for a^b"); solvedCheck("the number of unique values for a^b");
return unique.size(); return unique.size();

View File

@@ -1,4 +1,4 @@
//ProjectEuler/ProjectEulerCPP/Source/Problem3.cpp //ProjectEuler/ProjectEulerCPP/src/Problems/Problem3.cpp
//Matthew Ellison //Matthew Ellison
// Created: 09-28-18 // Created: 09-28-18
//Modified: 07-02-21 //Modified: 07-02-21