Updated comments

This commit is contained in:
2020-10-26 14:33:28 -04:00
parent 609baf482b
commit 0132ebebf3
2 changed files with 3 additions and 2 deletions

View File

@@ -1,7 +1,7 @@
//ProjectEuler/ProjectEulerCPP/headers/Problems/Problem1.hpp
//Matthew Ellison
// 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
//Unless otherwise listed all non-standard includes are my own creation and available from https://bibucket.org/Mattrixwv/myClasses
/*

View File

@@ -1,7 +1,7 @@
//ProjectEuler/ProjectEulerCPP/Source/Problem1.cpp
//Matthew Ellison
// 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
//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){
}
//Gets the sum of the progression of the 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
//The sum of progression formula is (n / 2)(a + l). n = number of terms, a = multiple, l = last term