mirror of
https://bitbucket.org/Mattrixwv/my-classes.git
synced 2025-12-06 18:23:57 -05:00
Added sort to the end of the getPrimes and getDivisors functions
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user