-
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
-
智能交通系统演示
说明: 智能交通管理系统,交通指示控制系统Delphi实例代码(Intelligent Transportation System Example Delphi Code)
- 2020-06-25 11:00:01下载
- 积分:1
-
IUST-Thesis
latex thesis format persian
- 2014-04-19 21:06:25下载
- 积分:1
-
仓库管理软件
说明: 这是一个创建自我的仓库的小程序,用于进库,出库,搜索功能的小程序(This is a small program to create a self-warehouse, for inbound, outbound, search functions of the small program)
- 2020-06-20 04:00:02下载
- 积分:1
-
代码
说明: 用matlab对一段音频信号进行采样,并用PCM编码后通过2FSK调制模拟信道传输,最后经过2FSK解调和PCM解码恢复音频信号(Matlab is used to sample a section of audio signal, PCM is used to code it, then it is transmitted through 2FSK modulation analog channel, and finally it is demodulated by 2FSK and decoded by PCM to recover the audio signal)
- 2020-06-03 15:50:25下载
- 积分:1
-
computationalgeometry
计算几何,英文版,写的十分详细,适合初学者入门学习,老手也可丛中学到不少知识(Computational geometry, English, written in great detail, suitable for beginners study entry, a pair of veterans may also learn a lot of knowledge)
- 2009-02-25 09:59:46下载
- 积分:1
-
excel对表软件
采用VBA实现对表。程序中采用了类似VB的界面,只要打开两张EXCEL表格,直接可以实现两张表的对比,更新操作。
- 2023-02-25 04:10:03下载
- 积分:1
-
3能用但看不懂,而且一看就很厉害
说明: 风电预测:能用但看不懂,而且一看就很厉害,加油!(Wind power forecast: It can be used but not understood, and it is very powerful at a glance. Come on!)
- 2020-07-12 02:51:52下载
- 积分:1
-
火车过桥全过程仿真(1)
用有限元分析软件ansys来仿真模拟火车过桥的过程中桥的受力分析(The deformation of high-speed railway track was simulated by ansys)
- 2020-06-24 11:40:02下载
- 积分:1
-
在。NET中,体现了与数据库相结合的强大威力!值得借鉴
在。NET中,体现了与数据库相结合的强大威力!值得借鉴-在. NET, the database reflects a combination of power! Worth learning
- 2023-08-15 01:25:04下载
- 积分:1