-
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
-
matlabgif
说明: matlab简单的把图片制作成GIF,如果有错误,请提出(Matlab simply makes the picture GIF. If there are any mistakes, please bring them up.)
- 2020-06-23 14:00:01下载
- 积分:1
-
netstatwx_v1.0
this program change title of menu of windows
- 2013-10-15 14:08:39下载
- 积分:1
-
嵌入式系统c语言编程入门(5),关于c语言编程的书籍
嵌入式系统c语言编程入门(5),关于c语言编程的书籍-C language programming of embedded systems portal (5), on c language programming books
- 2023-07-26 11:25:03下载
- 积分:1
-
D-S
说明: (D-S)基于认知无线电的频谱感知技术的研究,是一种信息融合的频谱感知技术。((DS) based on cognitive radio spectrum sensing technology research, is an information fusion spectrum sensing technology.)
- 2010-03-29 13:54:06下载
- 积分:1
-
PCtoLCD2002?????????
说明: 一款非常好用的汉字取模软件推荐给大家,大家可以试试。(A very easy to use Chinese character module software recommended to you, you can try.)
- 2019-11-22 17:15:00下载
- 积分:1
-
jisuanqi
matlab开发科学计算器 matlab GUI设计(matlab matlab GUI design, develop scientific calculator)
- 2012-12-11 09:55:31下载
- 积分:1
-
DonForex PerfectZones
DonForex PerfectZones Metatrader 4 Trading system
- 2018-07-06 05:39:43下载
- 积分:1
-
ansys moving heat flux
说明: 可以使用ANSYS对移动热源进行数值仿真,常用在材料加工工程的焊接领域,运用高斯移动热源来模拟焊接过程(emulated moving heat flux via ansys)
- 2019-01-23 17:54:34下载
- 积分:1
-
AdvInAbatSrc
说明: 这是一个简单的2d图形动画,是用VC编的,适合初学者参考。(This is a simple 2d graphics animation, VC series is the reference for beginners.)
- 2006-01-31 17:44:04下载
- 积分:1