mirror of
https://bitbucket.org/Mattrixwv/projecteulercpp.git
synced 2025-12-06 17:13:59 -05:00
Updated comments and made sure style was consistent
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
//ProjectEuler/C++/Headers/Problem31.hpp
|
||||
//ProjectEuler/ProjectEulerCPP/Headers/Problem31.hpp
|
||||
//Matthew Ellison
|
||||
// Created: 06-19-20
|
||||
//Modified: 06-19-20
|
||||
//Modified: 07-09-20
|
||||
//How many different ways can £2 be made using any number of coins?
|
||||
//Unless otherwise listed all non-standard includes are my own creation and available from https://bibucket.org/Mattrixwv/myClasses
|
||||
/*
|
||||
@@ -32,21 +32,26 @@
|
||||
|
||||
class Problem31 : public Problem{
|
||||
private:
|
||||
static int desiredValue;
|
||||
int permutations;
|
||||
//Variables
|
||||
//Static variables
|
||||
static int desiredValue; //The value of coins we want
|
||||
//Instance variables
|
||||
int permutations; //The number of permutations that are found
|
||||
public:
|
||||
//Constructor
|
||||
Problem31();
|
||||
virtual void solve();
|
||||
virtual std::string getString() const;
|
||||
virtual void reset();
|
||||
//Returns the number of correct permutations of the coins
|
||||
int getPermutations() const;
|
||||
//Operational functions
|
||||
virtual void solve(); //Solve the problem
|
||||
virtual void reset(); //Reset the problem so it can be run again
|
||||
//Gets
|
||||
virtual std::string getString() const; //Return a string with the solution to the problem
|
||||
int getPermutations() const; //Returns the number of correct permutations of the coins
|
||||
};
|
||||
|
||||
|
||||
/* Results:
|
||||
There are 73682 ways to make 2 pounds with the given denominations of coins
|
||||
It took 0.000 nanoseconds to solve this problem.
|
||||
It took an average of 1.916 microseconds to run this problem over 100 iterations
|
||||
*/
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user