Added sort to the end of the getPrimes and getDivisors functions

This commit is contained in:
2018-11-09 15:13:22 -05:00
parent 81b50f92f6
commit e77e66ef86

View File

@@ -9,6 +9,7 @@
#include <vector>
#include <cinttypes>
#include <algorithm>
namespace mee{
@@ -47,6 +48,7 @@ std::vector<T> getPrimes(T goalNumber){
foundFactor = false;
}
}
std::sort(primes.front(), primes.end());
return primes;
}
@@ -66,6 +68,7 @@ std::vector<T> getDivisors(T num){
}
}
}
std::sort(divisors.front(), divisors.end());
return divisors;
}