-
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
-
OPC Client本软件是一个利用OPC协议通讯的实例。其中用到的驱动是非注册版,如果您希望使用,请使用正版。...
OPC Client本软件是一个利用OPC协议通讯的实例。其中用到的驱动是非注册版,如果您希望使用,请使用正版。-OPC Client software is the use of a communications agreement OPC examples. Which to use the non-registered version, if you want to use, please use legitimate.
- 2023-03-17 07:10:04下载
- 积分:1
-
javascriptdiam代码!一个简单的日历控件!
javaScriptdiam 代码!
一个简单的日历控件-javaScriptdiam code! A simple calendar control!
- 2022-03-18 00:17:25下载
- 积分:1
-
CDMA2000移动通信系统在羚羊流密码算法…
在cdma2000移动通信系统使用ORYX流密码算法实现空中接口部分的数据加密。-Cdma2000 mobile communication system in the ORYX stream cipher algorithm used to achieve air-interface part of the data encryption.
- 2022-08-09 00:36:04下载
- 积分:1
-
这个是pulezz拼图游戏源码,不仅可游戏,还可以练习制作
这个是pulezz拼图游戏源码,不仅可游戏,还可以练习制作-This is a jigsaw puzzle pulezz source, not only the game, you can practice the production of
- 2023-04-16 00:45:03下载
- 积分:1
-
interrupt controller 设计
interrupt controller 设计-interrupt controller
- 2022-01-27 20:53:08下载
- 积分:1
-
查看yuv文件的软件,非常使用.可以有几种格式查看文件
查看yuv文件的软件,非常使用.可以有几种格式查看文件-View yuv document software, is the use of. There are several format can view the document
- 2023-08-03 16:35:03下载
- 积分:1
-
常用C 语言 运筹学算法
常用C 语言 运筹学算法-C-language algorithm tacticians
- 2023-06-19 07:35:03下载
- 积分:1
-
这是我业余做的一个学单车的小游戏,由于没有美工,图片用简单线条代替,需要安装directX,具体操作简单,游戏界面有介绍...
这是我业余做的一个学单车的小游戏,由于没有美工,图片用简单线条代替,需要安装directX,具体操作简单,游戏界面有介绍-This is my amateur done a study of small motorcycle games, in the absence of artists, pictures replaced with a simple lines need to install directX, the specific operation of a simple game interface is introduced
- 2022-12-29 01:20:04下载
- 积分:1
-
with a vc Wuzilianzhu development of the small game, using a Directdraw
一个用vc开发的五子连珠的小游戏,运用了Directdraw-with a vc Wuzilianzhu development of the small game, using a Directdraw
- 2022-01-26 03:52:18下载
- 积分:1