-
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
-
防火墙和网络安全方面的测试规范和国家标准,主要是将硬件防火墙。...
防火墙和网络安全方面的测试规范和国家标准,主要是将硬件防火墙。-Firewall and network security testing norms and national standards, mainly hardware firewall.
- 2022-03-26 19:07:35下载
- 积分:1
-
CPU access to information categories, a fairly complete package, access to infor...
获取CPU信息的类,封装比较完善,获取信息比较全面,包括频率,二级缓冲等。-CPU access to information categories, a fairly complete package, access to information more comprehensive, including the frequency, such as the secondary buffer.
- 2022-01-24 19:09:10下载
- 积分:1
-
用法:无效CRC(int,int,int)
Usage: void CRC(int*, int,int)
Input: XAR0:coded data(InputData)
XAR1:decoded CRC bits(CrcPoly)
T0: Length of coded data(CodeOutlen)
T1: Length of CRC bits(CrcPolylen)
Return: NO
Altered Registers: AC0-AC2,T2
Others: 8 bits of AC0 LSB is CRCcheck bit-Usage: void CRC (int*, int*, int, int) Input: XAR0: coded data (InputData) XAR1: decoded CRC bits (CrcPoly) T0: Length of coded data (CodeOutlen) T1: Length of CRC bits (CrcPolylen) Return: NO Altered Registers: AC0-AC2, T2 Others: 8 bits of AC0 LSB is CRCcheck bit
- 2022-01-26 03:25:53下载
- 积分:1
-
一个用于服务器与各客户端进行时间同步的源码.
一个用于服务器与各客户端进行时间同步的源码.-one for servers and the client time synchronization of the source.
- 2022-03-20 08:22:51下载
- 积分:1
-
初学VB时自已做的扫雷,完全模仿window扫雷,并有自已加的小功能
初学VB时自已做的扫雷,完全模仿window扫雷,并有自已加的小功能-VB beginner to do when their mine clearance, mine clearance window completely imitate, and have their own plus a small function
- 2022-06-18 18:22:11下载
- 积分:1
-
象棋游戏,c语言版,vc6.0 gunc++ 都可以编译成功,文本模式。值得学习,
申明此代码不是我写的,是pfan里的一个版主写的昵称叫雨中飞燕。
虽...
象棋游戏,c语言版,vc6.0 gunc++ 都可以编译成功,文本模式。值得学习,
申明此代码不是我写的,是pfan里的一个版主写的昵称叫雨中飞燕。
虽说是DOS环境的,可以很容易转换到其他操作系统下。-Chess game, c language, vc6.0 gunc++ can be successfully compiled, the text mode. Worthy of study, affirms that I did not write this code,it is a product of an manage in the pfan whose nickname was called Chebi rain.
- 2022-10-11 18:15:08下载
- 积分:1
-
一个很简单的,可以用asp进行ping命令和端口扫描的代码。
一个很简单的,可以用asp进行ping命令和端口扫描的代码。-A very simple, you can use asp to ping command code.
- 2022-07-07 15:18:07下载
- 积分:1
-
三层电梯控制器源码及报告和仿真时序图
可以作为课程设计或者毕业设计的参考 绝对管用...
三层电梯控制器源码及报告和仿真时序图
可以作为课程设计或者毕业设计的参考 绝对管用-Three elevator controller source and reporting and simulation timing diagram can be used as curriculum design or graduate design reference absolute effective
- 2022-02-26 08:10:33下载
- 积分:1
-
labview教材的配书课件。制作详细,可供参考。共6部分,下载后统一解压...
labview教材的配书课件。制作详细,可供参考。共6部分,下载后统一解压-LabVIEW courseware materials with the book. The production of detailed, for reference. A total of 6 parts, download decompression unification
- 2022-01-25 15:20:12下载
- 积分:1