- Category:
- ADO-ODBC
- Tags:
-
[C/C++]
[源码]
- File Size:
- 115kb
- Update:
- 2014-12-27
- Downloads:
- 0 Times
- Uploaded by:
- 光
Description: 1. Preparation of screening to find primes function: void sieve (bool isPrime [], int n) where isPrime [n] is a Boolean array, n is the array size. Because 2 is the first prime number, so set isPrime [0] and isPrime [1] the value is false, and set the rest of the elements of the initial value to true. Then 4 to n-1 every i, i determine whether it can be divisible by 2, if i can be divisible by 2, set isPrime [i] is false. For every possible value 2 to n/2 Repeat the above process, when the end of the operation, all the value of true isPrime [i] corresponding to the i is a prime number, they will be falling the sieve come. Test Procedure: Input: An integer representing the n output: 1 line, all the prime numbers between 1 and n, separated by a space between two prime number, a prime number after the last output, the output of a blank and blank lines, see the output function Disp code. For example, when the input 20, the output is as follows: 235711131719
To Search:
File list (Check if you may need any files):
2\3.cpp
.\c++_ch06_03.vcxproj
.\c++_ch06_03.vcxproj.filters
.\Debug\3.obj
.\.....\c++_ch06_03.lastbuildstate
.\.....\c++_ch06_03.log
.\.....\CL.read.1.tlog
.\.....\CL.write.1.tlog
.\.....\link-cvtres.read.1.tlog
.\.....\link-cvtres.write.1.tlog
.\.....\link-rc.read.1.tlog
.\.....\link-rc.write.1.tlog
.\.....\link.2484-cvtres.read.1.tlog
.\.....\link.2484-cvtres.write.1.tlog
.\.....\link.2484-rc.read.1.tlog
.\.....\link.2484-rc.write.1.tlog
.\.....\link.2484.read.1.tlog
.\.....\link.2484.write.1.tlog
.\.....\link.4604-cvtres.read.1.tlog
.\.....\link.4604-cvtres.write.1.tlog
.\.....\link.4604-rc.read.1.tlog
.\.....\link.4604-rc.write.1.tlog
.\.....\link.4604.read.1.tlog
.\.....\link.4604.write.1.tlog
.\.....\link.read.1.tlog
.\.....\link.write.1.tlog
.\.....\vc110.idb
.\.....\vc110.pdb
.\Debug
2