-
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
-
该文件是教你如何从根目录中找到你要删除的文件夹.
该文件是教你如何从根目录中找到你要删除的文件夹.-the document is to teach you how to find the root directory you want to delete the folder.
- 2022-02-20 22:01:46下载
- 积分:1
-
CADENCE的ALLERGO如果用过的话,相信这个东西是你所需要的,他是封装生成工具,会带来很大的方便。...
CADENCE的ALLERGO如果用过的话,相信这个东西是你所需要的,他是封装生成工具,会带来很大的方便。-magnitude of ALLERGO if used, I believe this is something you need, He is Packaging generation instruments will bring great convenience.
- 2022-07-14 23:32:53下载
- 积分:1
-
这是关于云南白族村的vrml原码,如果看代码,请用vrmlpad编辑器打开,如果预览请用bs....
这是关于云南白族村的vrml原码,如果看代码,请用vrmlpad编辑器打开,如果预览请用bs.-This is on the village of Yunnan Bai VRML original code, if we look at the code, please use vrmlpad editor to open, if the preview please bs.
- 2022-02-12 16:13:05下载
- 积分:1
-
一个非常好的闪光,大家可以参考一下它的功能和风格,是一个很好的文档
一个很漂亮的FLASH,大家可以参考其功能及风格,是个不错的文件-a very nice Flash, we can refer to its function and style, is a good document
- 2022-03-05 03:42:35下载
- 积分:1
-
SPI通讯 学习之用 FreeScale
SPI通讯 学习之用 FreeScale-SPI communication
- 2022-03-02 00:46:13下载
- 积分:1
-
成绩管理C语言程序代码,可以进行学生成绩的录入学生信息的录入删除等等。...
成绩管理C语言程序代码,可以进行学生成绩的录入学生信息的录入删除等等。-Performance management of C language program code, and can input student information student achievement of the entry to delete and so on.
- 2023-01-13 12:05:03下载
- 积分:1
-
c language used tanks games for the game just contact the programming novice
一款用c语言编写的坦克游戏,适合刚刚接触游戏的编程新手-c language used tanks games for the game just contact the programming novice
- 2022-05-15 20:33:43下载
- 积分:1
-
图书管理信息系统的DELPHI源代码,并在该系统里面附加一些小工具供大家学习...
图书管理信息系统的DELPHI源代码,并在该系统里面附加一些小工具供大家学习-Book Management Information System DELPHI source code, and attached to the system inside the gadget for everyone to learn
- 2022-07-27 11:43:16下载
- 积分:1
-
audio and speech compression,image restoration,ezw tree using trellis codes
audio and speech compression,image restoration,ezw tree using trellis codes
- 2022-01-25 23:20:56下载
- 积分:1