-
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
-
媒体播放器与风险投资和风险投资媒体的编辑,包括详细的描述和说明…
带有VC媒体播放器和VC媒体编辑器,包括详细说明和附件的原代码!
- 2023-01-13 21:30:03下载
- 积分:1
-
可本地机器的IP地址,同时对指定的IP地址…
可以得到本地机器IP地址,同时对指定IP地址进行检测,是否正常-Can be the local machine IP address, at the same time on the specified IP address detection, and whether it is normal
- 2022-09-21 17:45:03下载
- 积分:1
-
设计模式中 代理模式和工厂模式的C++实现
关于设计模式的问题在IT面试时越来越多的被问到,该源码实现了代理模式和工厂模式,其中代理模式在main函数中被注释掉了,当前运行的是工厂模式,如果想了解代理模式,将注释去掉即可。
- 2023-03-09 19:10:03下载
- 积分:1
-
针对飞利浦LPC214x的虚拟串口程序,这个是改进版,比源程序稳定...
针对飞利浦LPC214x的虚拟串口程序,这个是改进版,比源程序稳定-against Philips LPC214x virtual serial port procedures, improved version of this than the source stability
- 2022-05-27 02:15:26下载
- 积分:1
-
描述
Description
Input c,Output a and b that a + b = c
Input
a signed 32bit integer c
Output
Output just one pair of signed 32bit integers a and b
-Description
Input c,Output a and b that a+ b = c
Input
a signed 32bit integer c
Output
Output just one pair of signed 32bit integers a and b
- 2022-12-05 10:05:03下载
- 积分:1
-
这是php编的论坛的原代码,希望正在学习php的同行借鉴一下,我们学校的论坛原代码就是这个 !...
这是php编的论坛的原代码,希望正在学习php的同行借鉴一下,我们学校的论坛原代码就是这个 !-This is php series of the Forum of the original code, php hope is learning from peers, we are a forum for schools is the original code!
- 2022-11-02 09:10:03下载
- 积分:1
-
一个简单易用的串口调试工具.全api完成.
一个简单易用的串口调试工具.全api完成.-A simple serial-to-use debug tools. The completion of the entire api.
- 2022-02-25 06:45:26下载
- 积分:1
-
这是一个驱动层的程序,实现了把文件映射成一个虚拟磁盘的功能。...
这是一个驱动层的程序,实现了把文件映射成一个虚拟磁盘的功能。-This is a driver layer procedures to realize a file mapping into a virtual disk function.
- 2022-09-17 07:25:03下载
- 积分:1
-
practical manual function MFC MFC MFC function practical manual function practic...
MFC 函数实用手册
MFC 函数实用手册-practical manual function MFC MFC MFC function practical manual function practical manual
- 2022-05-29 08:46:54下载
- 积分:1