mirror of
https://bitbucket.org/Mattrixwv/projecteulercpp.git
synced 2025-12-06 17:13:59 -05:00
Updated to work with the new libraries
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
//ProjectEuler/ProjectEulerCPP/headers/Problems/Problem25.hpp
|
||||
//Matthew Ellison
|
||||
// Created: 11-13-18
|
||||
//Modified: 08-28-20
|
||||
//Modified: 07-02-21
|
||||
//What is the index of the first term in the Fibonacci sequence to contain 1000 digits?
|
||||
//Unless otherwise listed all non-standard includes are my own creation and available from https://bibucket.org/Mattrixwv/myClasses
|
||||
//This file contains a header from the gmp library. The library is used for large integers.
|
||||
//You can find more information about them at https://gmplib.org/
|
||||
//When compiling this file you need to have the gmp library installed as well as linking the libraries to your executable using the -lgmpxx and -lgmp flags
|
||||
/*
|
||||
Copyright (C) 2020 Matthew Ellison
|
||||
Copyright (C) 2021 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
|
||||
@@ -23,13 +23,12 @@
|
||||
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 PROBLEM25_HPP
|
||||
#define PROBLEM25_HPP
|
||||
|
||||
|
||||
#include <string>
|
||||
#include "gmpxx.h"
|
||||
#include <gmpxx.h>
|
||||
#include "Problem.hpp"
|
||||
|
||||
|
||||
@@ -48,7 +47,7 @@ public:
|
||||
virtual void solve(); //Solve the problem
|
||||
virtual void reset(); //Reset the problem so it can be run again
|
||||
//Gets
|
||||
virtual std::string getResult(); //Return a string with the solution to the problem
|
||||
virtual std::string getResult() const; //Return a string with the solution to the problem
|
||||
mpz_class getNumber() const; //Returns the Fibonacci number asked for
|
||||
std::string getNumberString() const; //Returns the Fibonacci number asked for as a string
|
||||
mpz_class getIndex() const; //Returns the index of the requested Fibonacci number
|
||||
@@ -62,4 +61,4 @@ Its index is 4782
|
||||
It took an average of 241.017 milliseconds to run this problem over 100 iterations
|
||||
*/
|
||||
|
||||
#endif //PROBLEM25_HPP
|
||||
#endif //PROBLEM25_HPP
|
||||
|
||||
Reference in New Issue
Block a user