Skip to content

Commit

Permalink
A few minor updates for example code.
Browse files Browse the repository at this point in the history
  • Loading branch information
burhop committed Jan 11, 2020
1 parent 70a0000 commit d0958ba
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions PrimeExamples/PrimeExamples.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,7 @@ int main(int argc, char*argv[])
maxValue = prime2.GetMaxValue();
std::cout << "Found " << count << " prime numbers between 0 and " << maxValue << std::endl;
// Lets see how many primes in groups of 100
std::cout << "0-100 : " << prime2.CountPrimes(0, 100) << std::endl;
std::cout << "101-200 : " << prime2.CountPrimes(101, 200) << std::endl;
std::cout << "201-300 : " << prime2.CountPrimes(201, 300) << std::endl;
std::cout << "301-400 : " << prime2.CountPrimes(301, 400) << std::endl;
std::cout << "0-1000 : " << prime2.CountPrimes(0, 1000) << std::endl;
std::cout << "0-10000 : " << prime2.CountPrimes(0, 10000) << std::endl;
std::cout << "0-100000 : " << prime2.CountPrimes(0, 100000) << std::endl;
std::cout << "0-1000000 : " << prime2.CountPrimes(0, 1000000) << std::endl;
Expand All @@ -121,13 +118,10 @@ int main(int argc, char*argv[])
else if (opt == 2)
{
prime.LoadFromFile("RunRunRun");
std::cout << "total integers: " << prime.GetMaxCount() << std::endl;
std::cout << "Largest Prime : " << prime.GetMaxPrime() << std::endl;
std::cout << "Primes Found : " << prime.GetMaxCount() << std::endl;
std::cout << "0-100 : " << prime.CountPrimes(0, 100) << std::endl;
std::cout << "101-200 : " << prime.CountPrimes(101, 200) << std::endl;
std::cout << "201-300 : " << prime.CountPrimes(201, 300) << std::endl;
std::cout << "301-400 : " << prime.CountPrimes(301, 400) << std::endl;
std::cout << "Total integers searched: " << prime.GetMaxValue() << std::endl;
std::cout << "Largest prime : " << prime.GetMaxPrime() << std::endl;
std::cout << "Total primes Found : " << prime.GetMaxCount() << std::endl;
std::cout << "0-1000 : " << prime.CountPrimes(0, 1000) << std::endl;
std::cout << "0-10000 : " << prime.CountPrimes(0, 10000) << std::endl;
std::cout << "0-100000 : " << prime.CountPrimes(0, 100000) << std::endl;
std::cout << "0-1000000 : " << prime.CountPrimes(0, 1000000) << std::endl;
Expand Down

0 comments on commit d0958ba

Please sign in to comment.