Updated to work with the new libraries

This commit is contained in:
2021-07-03 02:38:00 -04:00
parent fd54eb90d8
commit 9660fe9287
82 changed files with 794 additions and 1008 deletions

View File

@@ -1,7 +1,7 @@
//ProjectEuler/ProjectEulerCPP/headers/Problems/Problem37.hpp
//Matthew Ellison
// Created: 06-30-21
//Modified: 06-30-21
//Modified: 07-02-21
//Find the sum of the only eleven primes that are both truncatable from left to right and right to left (2, 3, 5, and 7 are not counted).
//Unless otherwise listed all non-standard includes are my own creation and available from https://bibucket.org/Mattrixwv/myClasses
/*
@@ -20,11 +20,11 @@
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef PROBLEM37_HPP
#define PROBLEM37_HPP
#include <cinttypes>
#include <string>
#include <vector>
#include "Problem.hpp"
@@ -46,11 +46,12 @@ public:
virtual void solve(); //Solve the problem
virtual void reset(); //Reset the problem so it can be run again
//Gets
virtual std::string getResult(); //Returns a string with the solution to the problem
std::vector<uint64_t> getTruncatablePrimes(); //Returns the list of primes that can be truncated
uint64_t getSumOfPrimes(); //Get the sum of all primes in truncPrimes
virtual std::string getResult() const; //Returns a string with the solution to the problem
std::vector<uint64_t> getTruncatablePrimes() const; //Returns the list of primes that can be truncated
uint64_t getSumOfPrimes() const; //Get the sum of all primes in truncPrimes
};
/* Results:
The sum of all left and right truncatable primes is 748317
It took an average of 63.831 milliseconds to run this problem over 100 iterations