mirror of
https://bitbucket.org/Mattrixwv/projecteulercpp.git
synced 2025-12-06 17:13:59 -05:00
Updated comments
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
//ProjectEuler/ProjectEulerCPP/headers/Problems/Problem1.hpp
|
//ProjectEuler/ProjectEulerCPP/headers/Problems/Problem1.hpp
|
||||||
//Matthew Ellison
|
//Matthew Ellison
|
||||||
// Created: 09-28-18
|
// Created: 09-28-18
|
||||||
//Modified: 08-28-20
|
//Modified: 10-26-20
|
||||||
//What is the sum of all the multiples of 3 or 5 that are less than 1000
|
//What is the sum of all the multiples of 3 or 5 that are less than 1000
|
||||||
//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
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
//ProjectEuler/ProjectEulerCPP/Source/Problem1.cpp
|
//ProjectEuler/ProjectEulerCPP/Source/Problem1.cpp
|
||||||
//Matthew Ellison
|
//Matthew Ellison
|
||||||
// Created: 07-10-19
|
// Created: 07-10-19
|
||||||
//Modified: 08-28-20
|
//Modified: 10-26-20
|
||||||
//What is the sum of all the multiples of 3 or 5 that are less than 1000
|
//What is the sum of all the multiples of 3 or 5 that are less than 1000
|
||||||
//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
|
||||||
/*
|
/*
|
||||||
@@ -37,6 +37,7 @@ uint64_t Problem1::MAX_NUMBER = 999;
|
|||||||
Problem1::Problem1() : Problem("What is the sum of all the multiples of 3 or 5 that are less than 1000?"), fullSum(0){
|
Problem1::Problem1() : Problem("What is the sum of all the multiples of 3 or 5 that are less than 1000?"), fullSum(0){
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Gets the sum of the progression of the multiple
|
||||||
uint64_t Problem1::sumOfProgression(uint64_t multiple){
|
uint64_t Problem1::sumOfProgression(uint64_t multiple){
|
||||||
uint64_t numTerms = std::floor(MAX_NUMBER / multiple); //This gets the number of multiples of a particular number that is < MAX_NUMBER
|
uint64_t numTerms = std::floor(MAX_NUMBER / multiple); //This gets the number of multiples of a particular number that is < MAX_NUMBER
|
||||||
//The sum of progression formula is (n / 2)(a + l). n = number of terms, a = multiple, l = last term
|
//The sum of progression formula is (n / 2)(a + l). n = number of terms, a = multiple, l = last term
|
||||||
|
|||||||
Reference in New Issue
Block a user