-
Find prime numbers prepared by screening the function: void sieve (bool isPrime...
编写筛选查找素数函数:
void sieve(bool isPrime[], int n)
其中isPrime[ ]为一个布尔型数组,n为数组大小。由于2是第一个素数,
所以设置isPrime[0]和isPrime[1]的值为false,并设置其余的元素初值为true。
然后对从4到n-1的每一个i,判断i是否能够被2整除,如果i能够被2整除,则设置isPrime[i]为false。
对从2到n/2的每一个可能的数值重复以上处理,当操作结束时,所有值为true的isPrime[i]所对应的i就是素数,它们将是从筛子中掉下来的。-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.
- 2023-03-02 04:45:03下载
- 积分:1
-
container class and the realization of the definition, because the need for the...
容器类的实现和定义,由于使用迭代器需 要关于STL容器类和算法的知识,-container class and the realization of the definition, because the need for the use of iterative STL containers on the type and algorithms knowledge,
- 2022-03-14 09:50:30下载
- 积分:1
-
编程模拟实现数据链路层协议中的停等协议.
用c++写的,对初学tcp ip协议的人,有很大帮助...
编程模拟实现数据链路层协议中的停等协议.
用c++写的,对初学tcp ip协议的人,有很大帮助-this is a protical that implements tingdeng protical in data_link .
it is a perfact work that you can hand it to teacher .i think it is useful for the people who just start to learn the tcp ip protical . it really helps a lot
- 2022-09-06 00:40:02下载
- 积分:1
-
very cool style tab Tab
非常酷Office2003风格的Tab选项卡-very cool style tab Tab
- 2023-08-11 04:30:03下载
- 积分:1
-
一个ada的编译器
一个ada的编译器-a compiler
- 2023-01-09 17:15:04下载
- 积分:1
-
ISING MODEL模拟磁滞回线,用FORTRAN软件包打开
ISING MODEL模拟磁滞回线,用FORTRAN软件包打开-ISING MODEL simulated hysteresis loop with a FORTRAN software package to open
- 2023-07-23 00:00:02下载
- 积分:1
-
《文明进化史》策略游戏源码+编译资源。收集到的一个游戏源码。...
《文明进化史》策略游戏源码+编译资源。收集到的一个游戏源码。-"history of the evolution of civilization" strategy game-source compiler resources. Collected a game-source.
- 2022-03-13 16:39:50下载
- 积分:1
-
btncolorbtncolorbtncolorbtncolorbtncolorbtncolorbtncolorbtncolorbtncolor
按钮颜色 按钮颜色 按钮颜色 按钮颜色 按钮颜色-btncolorbtncolorbtncolorbtncolorbtncolorbtncolorbtncolorbtncolorbtncolor
- 2022-03-24 10:35:57下载
- 积分:1
-
STAB is a new active probing tool for locating thin links on a network path. A t...
STAB is a new active probing tool for locating thin links on a network path. A thin link is a link with less available bandwidth than all links preceding it on the path. The last thin link on the path is the link with the minimum available bandwidth or tight link. STAB combines the concept of "self-induced congestion", the probing technique of "packet tailgating", and special probing trains called "chirps" to efficiently locate the thin links.
- 2023-07-29 03:10:03下载
- 积分:1
-
此代码是本人一年前所编写 对JAVA初学者可能会又帮助 在数据库连接上 效率较高...
此代码是本人一年前所编写 对JAVA初学者可能会又帮助 在数据库连接上 效率较高-year ago, I prepared for Java beginners may also help connect the database more efficient
- 2023-08-01 16:30:04下载
- 积分:1