-
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
-
可视为小到中等大小的公司基本的POS
A Visual basic POS for small to medium sized companies
- 2022-05-06 08:07:18下载
- 积分:1
-
it is OK
it can run
树的遍历功能更仔细地说就是:树的主要四部份是根、干、枝、叶。树根一般在地下,在一棵树的底部有很多根。
在树干的部分分为五层。第一层是树皮。树皮是树干的表层,可以保护树身,并防止病害入侵。在树皮的下面是韧皮部。这一层纤维质组织把糖分从树叶运送下来。第三层是形成层。这一层十分薄,是树干的生长部分,所有其他细胞都是自此层而来。第四层是边材。这一层把水分从根部输送到树身各处,此层通常较心材浅色。第五层就是心材。心材是老了的边材,二者合称为木质部。树干绝大部分都是心材。
-it is OK
it can run
- 2023-03-01 01:15:04下载
- 积分:1
-
一些用到的函数 功能齐全,希望能对网友有所帮助
一些用到的函数 功能齐全,希望能对网友有所帮助-some use the Function complete, and hopes to help netizens
- 2022-03-03 22:09:31下载
- 积分:1
-
This is a project on flight reservation system
This is a project on flight reservation system
- 2022-09-15 02:45:03下载
- 积分:1
-
IAR EWARM 5.11。凯基和ID。
IAR EWARM 5.11.KEYGEN&ID.
- 2022-02-12 17:05:53下载
- 积分:1
-
C++练习小代码
C++练习小代码,适合新手。
集合了10个新手练习C++的代码,比较简单,主要是给刚开始学习C++的童鞋一些入门小代码,如果是老手就不用下载了。
- 2022-03-23 07:24:18下载
- 积分:1
-
自己用C语言编写的NDS掌机运行的贪食蛇游戏,用了PAlib函数库,与大家分享,希望对大家有帮助。。。编译前请先确认安装了devkitPro...
自己用C语言编写的NDS掌机运行的贪食蛇游戏,用了PAlib函数库,与大家分享,希望对大家有帮助。。。编译前请先确认安装了devkitPro-Their use of C language running贪食蛇portable NDS games, spent PAlib library to share with you, in the hope that everyone has to help. . . Pre-compiler is installed make sure devkitPro
- 2023-05-10 10:10:04下载
- 积分:1
-
单片机入门的书,很适合 初学者,U1=89C51
U2=555
U3=MAX232
U4=24C01
U6=X25045看门狗
X1=共阳数...
单片机入门的书,很适合 初学者,U1=89C51
U2=555
U3=MAX232
U4=24C01
U6=X25045看门狗
X1=共阳数码管 -Singlechip book entry, it is suitable for beginners, U1 = 89C51U2 = 555U3 = MAX232U4 = 24C01U6 = X25045 watchdog X1 = total yang digital tube
- 2022-01-28 18:03:24下载
- 积分:1
-
msp 温控的代码,精度不太高。但是,比较简易的代码。
msp 温控的代码,精度不太高。但是,比较简易的代码。-msp temperature control of the code, not too high accuracy. However, the relatively simple code.
- 2022-03-18 01:58:43下载
- 积分:1