Speed up development with full-stack environments for every branch.

Learn More

Eratostene Sieve [C++]

Forked from Hello World C++ Example.

0 Runs 27 Views 17 Copies
Saved

Saved

Guildenstern70 3

Guildenstern70
published 2 years ago

//
// Eratostene Sieve
// by Alessio Saltarin 2015.
//


#include <iostream>
#include "eratostene.h"

using namespace std;


int main()
{
    Eratostene* eobj = new Eratostene();

    cout << "Computing primes..."<< endl;
    eobj->crivello();
    UINT nrPrimes = eobj->primesLength();
    cout << "Found " << nrPrimes << " primes." << endl;
    auto primes = eobj->primes();
    delete eobj;
    for (UINT prime : primes)
    {
        std::cout << "> " << prime << std::endl;
    }
    std::cout << "Done." << std::endl;
    return 0;
}
Please login/signup to get access to the terminal.

Your session has timed out.

Dismiss (the page may not function properly).