-
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
-
巧用事件开发小软件。易语言源码
巧妙利用事件来开发的一个小小软件。易语言源码-Clever use of events to develop a small software. Easy language source
- 2022-09-26 21:50:03下载
- 积分:1
-
This article from the fieldbus control system development of the current situati...
本文从现场总线控制系统的发展现状出发,遵循现场总线控制系统标准的体系结构,仍由通用组态软件实现监控管理功能,由现场总线智能仪表实现生产控制功能。但在连接通用组态软件与现场总线智能仪表的信息通道中,采用OPC服务器、OPCActiveX控件取代10驱动程序,实现与Matlba数据共享和互联,无干扰地增加Matlba强大的符号、数值计算、矩阵运算以及图形显示的功能,实施先进控制、优化控制。
-This article from the fieldbus control system development of the current situation, following the standard fieldbus control system architecture, generic configuration software is still realize monitoring and management functions, by the field bus intelligent instruments of production control functions. However, in general configuration software to connect with fieldbus intelligent instrument information channel, the use of OPC server, OPCActiveX controls to replace the 10 drivers, and realize data sharing and Matlba the Internet without interference to increase Matlba powerful symbols, numerical calculation, matrix calculation and graphical display features, the implementation of advanced control, optimal control.
- 2022-09-22 20:20:03下载
- 积分:1
-
分数阶Liu系统与分数阶统一系统中的混沌现象及二者的异结构同步...
分数阶Liu系统与分数阶统一系统中的混沌现象及二者的异结构同步-Fractional-order Liu system and the fractional order unified system of chaotic phenomena and the different structure of both synchronous
- 2022-10-18 14:10:04下载
- 积分:1
-
数据结构与算法分析:C语言描述(英文版)习题答案
数据结构与算法分析:C语言描述第二版 的习题答案本书中含有对Addison-Wesley 著的课本第二版大多数习题的答案 .目录1. Chapter 1: 介绍 12. Chapter 2: 算法分析 43. Chapter 3: 列、栈和队列 74. Chapter 4: 树 145. Chapter 5: 哈希 256. Chapter 6: 优先队列 (堆) . 297. Chapter 7: 筛选 .. 368. Chapter 8: 分离集 ADT 429. Chapter 9: 图形算法 4510. Chapter 10: 算法设计技术 . 5411. Chapter 11: 分摊分析 6312. Chapter 12: 高级数据结构和实现 .. 66
- 2022-03-01 04:41:42下载
- 积分:1
-
pcb转SCH攻略
pcb转SCH攻略-(protel)pcb转SCH攻略-(protel)-pcb switch SCH Raiders- (protel) pcb switch SCH Raiders- (protel)
- 2022-03-05 04:55:34下载
- 积分:1
-
进度条,多媒体里面的内容!是一个水流的效果,点击鼠标可以让水流跟着鼠标移动!...
进度条,多媒体里面的内容!是一个水流的效果,点击鼠标可以让水流跟着鼠标移动!-The progress bar, multi-media content inside! Is a flow effect, click on the mouse will allow water to follow the mouse move!
- 2022-08-18 01:56:34下载
- 积分:1
-
TVGame,是一个用手机短信控制的电视游戏的手机模拟端
TVGame,是一个用手机短信控制的电视游戏的手机模拟端-TVGame, is a used cell phone text messages to the control of cell phone video game simulation-
- 2022-08-16 04:51:18下载
- 积分:1
-
红路灯效果,南北杉树5秒,东西一秒,重复N次,安逸人家内存、退出...
红路灯效果,南北杉树5秒,东西一秒,重复N次,安逸人家内存、退出-hld function,nanbei 5miao ,1miao shanshuo ,
- 2022-12-14 01:05:03下载
- 积分:1
-
在现代C++程序。适用于网络相关软件的开发
Modem Program in C++. Is suitable to add in network related software development
- 2022-10-09 02:10:02下载
- 积分:1