Files
ProjectEulerCPP/Headers/Problem31.hpp
2020-07-08 20:38:37 -04:00

54 lines
1.5 KiB
C++

//ProjectEuler/C++/Headers/Problem31.hpp
//Matthew Ellison
// Created: 06-19-20
//Modified: 06-19-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
/*
Copyright (C) 2020 Matthew Ellison
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
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 PROBLEM31_HPP
#define PROBLEM31_HPP
#include <string>
#include <vector>
#include "Problem.hpp"
class Problem31 : public Problem{
private:
static int desiredValue;
int permutations;
public:
Problem31();
virtual void solve();
virtual std::string getString() const;
virtual void reset();
//Returns the number of correct permutations of the coins
int getPermutations() const;
};
/* Results:
There are 73682 ways to make 2 pounds with the given denominations of coins
It took 0.000 nanoseconds to solve this problem.
*/
#endif //PROBLEM31_HPP