-
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
-
complete source code for game quake 1 by id software, a must have for game progr...
complete source code for game quake 1 by id software, a must have for game programers
- 2022-04-01 17:16:40下载
- 积分:1
-
本人收集并经过运行的与直接扩频通信的相关的两个非常好的MATLAB仿真程序!...
本人收集并经过运行的与直接扩频通信的相关的两个非常好的MATLAB仿真程序!-I collect and run through the DSSS and the associated two very good way MATLAB Order!
- 2023-01-26 08:05:04下载
- 积分:1
-
a game, not big, super yards pear is a reprint of operation and eight of the gam...
一个FLASH游戏 ,不是很大 ,是超级码梨的翻版,操作和8位机的游戏一样. -a game, not big, super yards pear is a reprint of operation and eight of the game machine.
- 2022-10-15 11:00:02下载
- 积分:1
-
Delphi 彩票模拟开奖
应用背景Delphi 彩票模拟开奖程序 包含源码及程序实列关键技术支持 双色球 15选5 福彩3D 22选5 七星彩 等等 制作了一个函数 直接调用即可实现
- 2022-11-10 18:35:03下载
- 积分:1
-
图书管理系统,vb制作,源代码
图书管理系统,vb制作,源代码-library management system, vb production, the source code
- 2022-05-29 20:29:32下载
- 积分:1
-
可以用此程序实现一个经典好玩的小游戏:五子棋
可以用此程序实现一个经典好玩的小游戏:五子棋-can use this program to achieve a classic fun little game : 331
- 2022-07-07 09:18:28下载
- 积分:1
-
graded background, in which top
渐变背景,在窗体中从上至下依次绘制多个矩形,使它们的填充色从蓝变化到黑,就能很好地模拟出渐变效果-graded background, in which top-down windows were drawing more than rectangular, filling their color changes from blue to black. it will be able to simulate effects of graded
- 2023-08-21 21:20:02下载
- 积分:1
-
color颜色拾取器,超强功能转换,良好界面设计
color颜色拾取器,超强功能转换,良好界面设计-color color picker, super functional transformation, good interface design
- 2022-07-05 09:21:56下载
- 积分:1
-
DHTML menu source codes. You can use this file souce codes to create your own me...
DHTML menu source codes. You can use this file souce codes to create your own menus.
- 2022-01-25 22:08:01下载
- 积分:1