From e77e66ef86bf488f3b2c4484b1ba41f4225dd1bf Mon Sep 17 00:00:00 2001 From: Matthew Ellison Date: Fri, 9 Nov 2018 15:13:22 -0500 Subject: [PATCH] Added sort to the end of the getPrimes and getDivisors functions --- Algorithms.hpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Algorithms.hpp b/Algorithms.hpp index 7662eec..9c35b38 100644 --- a/Algorithms.hpp +++ b/Algorithms.hpp @@ -9,6 +9,7 @@ #include #include +#include namespace mee{ @@ -47,6 +48,7 @@ std::vector getPrimes(T goalNumber){ foundFactor = false; } } + std::sort(primes.front(), primes.end()); return primes; } @@ -66,6 +68,7 @@ std::vector getDivisors(T num){ } } } + std::sort(divisors.front(), divisors.end()); return divisors; }