formatting source-code for d7af6fdc8c

This commit is contained in:
github-actions
2020-05-29 23:26:30 +00:00
parent edb3d51ec2
commit 7ad1f171c1
176 changed files with 5342 additions and 4288 deletions

View File

@@ -9,12 +9,15 @@
/** Generate an increasingly large number of primes
* and store in a list
*/
std::vector<int> primes(int max) {
std::vector<int> primes(int max)
{
max++;
std::vector<int> res;
std::vector<bool> numbers(max, false);
for (int i = 2; i < max; i++) {
if (!numbers[i]) {
for (int i = 2; i < max; i++)
{
if (!numbers[i])
{
for (int j = i; j < max; j += i) numbers[j] = true;
res.push_back(i);
}
@@ -23,7 +26,8 @@ std::vector<int> primes(int max) {
}
/** main function */
int main() {
int main()
{
std::cout << "Calculate primes up to:\n>> ";
int n;
std::cin >> n;