Welcome![Sign In][Sign Up]
Location:
Downloads SourceCode Windows Develop Other
Title: 2 Download
 Description: Find prime numbers prepared by screening the function: void sieve (bool isPrime [], int n) which isPrime [] as a Boolean array, n is the size of the array. Because 2 is the first prime number, so set the isPrime [0], and isPrime [1] a value of false, and set the initial value of the remaining elements of true. And then from 4 to n-1 for each i, to determine whether i can be divisible by 2, if i can be divisible by 2, then set the isPrime [i] is false. From 2 to n/2 possible values for each one to repeat the above processing, when the operation ended, all the true value of the isPrime [i] corresponding to i is a prime number, they will be falling from the sieve in the past.
 To Search: int
File list (Check if you may need any files):
2\2.dsp
.\2.dsw
.\2.ncb
.\2.opt
.\2.suo
.\Debug\sieve.exe
.\.....\sieve.ilk
.\.....\sieve.obj
.\.....\sieve.pch
.\.....\sieve.pdb
.\.....\solveroot.obj
.\.....\vc60.idb
.\.....\vc60.pdb
.\sieve.cpp
.\sieve.dsp
.\sieve.dsw
.\sieve.ncb
.\sieve.opt
.\sieve.plg
.\Debug
2
    

CodeBus www.codebus.net